473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problem with Long Stored Proc.

Hi

I have a C# (windows app) program where I call several stored procs. However there stored proc are very long (total of about 15-20 minutes)

My Problem is that when a execute the program, it kind of stalls, and its status is NOT RESPONDING. But it seems to execute the Store Proc OK. But we don't see the regular user interface anymore, and it looks like if the program has crashed... Any idea what I can do to smoothen the user experience

(I have put the CommandTimeout to a large number, and I have sure that it is not a connection or privileges problem.

thanks

Jenny
Nov 15 '05 #1
3 1209
Suggestions:

1. See what you can do to improve query performance, including
pre-aggregation of the data during off times (ad hoc will not work here, but
common reports will). Denormalization and indexes are other options.

2. Determine if the data can be moved to a data warehouse for the types of
queries, as data warehouses have great value if the data is not OLTP.

3. If neither of the above work, consider throwing the data retrieval to
another thread and creating an event when the data is returned. If you store
the data in a DataSet, the user can choose when to get back to the query.
When you spawn the thread, tell the user it will take some time and they
should do something else. You will inform them when their report is
returned.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Jenny" <an*******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
Hi,

I have a C# (windows app) program where I call several stored procs. However there stored proc are very long (total of about 15-20 minutes).
My Problem is that when a execute the program, it kind of stalls, and its status is NOT RESPONDING. But it seems to execute the Store Proc OK. But we
don't see the regular user interface anymore, and it looks like if the
program has crashed... Any idea what I can do to smoothen the user
experience?
(I have put the CommandTimeout to a large number, and I have sure that it is not a connection or privileges problem.)
thanks!

Jenny

Nov 15 '05 #2
Sounds like a place where threads might be useful. When your UI needs to
execute the stored procedures, it can spawn a new thread and all SP work
will be done in that new thread. That way control can return to your main
application loop.

"Jenny" <an*******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
Hi,

I have a C# (windows app) program where I call several stored procs. However there stored proc are very long (total of about 15-20 minutes).
My Problem is that when a execute the program, it kind of stalls, and its status is NOT RESPONDING. But it seems to execute the Store Proc OK. But we
don't see the regular user interface anymore, and it looks like if the
program has crashed... Any idea what I can do to smoothen the user
experience?
(I have put the CommandTimeout to a large number, and I have sure that it is not a connection or privileges problem.)
thanks!

Jenny

Nov 15 '05 #3
As the others already said - put it in a worker thread.

Here's a great article on how to do that:

http://msdn.microsoft.com/vbasic/usi...ult.aspx?pull=
/library/en-us/dnadvnet/html/vbnet09272002.asp

Eric

"Jenny" <an*******@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
Hi,

I have a C# (windows app) program where I call several stored procs. However there stored proc are very long (total of about 15-20 minutes).
My Problem is that when a execute the program, it kind of stalls, and its status is NOT RESPONDING. But it seems to execute the Store Proc OK. But we
don't see the regular user interface anymore, and it looks like if the
program has crashed... Any idea what I can do to smoothen the user
experience?
(I have put the CommandTimeout to a large number, and I have sure that it is not a connection or privileges problem.)
thanks!

Jenny


Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: none | last post by:
Hello all, I wrote a shell program a few years ago in VB6 that needs to be modified. The problem I have is this: The SysAdmin uses this shell in place of Explorer, so there is no taskbar. When...
4
by: Nyul | last post by:
Gurus, I have a verb big problem which I'm unable to explain. We have a DB2 V6.1.0 on AIX 4.3 I want to make a C stored procedure which at the end will be called by a PHP script. The...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
2
by: Rhino | last post by:
I am getting an sqlcode of -927 when I execute SQL within a COBOL stored procedure in DB2 OS/390 Version 6 on OS/390. I have looked at the error message for that condition and tried everything I...
2
by: Mike Hutton | last post by:
I have a rather odd problem. I have a SP which uses temp. tables along the way, and then returns a table of results: CREATE PROCEDURE dbo.usp_myproc( @pNameList VARCHAR(6000) ) AS
14
by: Roy | last post by:
Apologies for the cross-post, but this truly is a two-sided question. Given the option of creating Looping statements within a stored proc of sql server or in the code-behind of an .net webpage,...
6
by: Not4u | last post by:
Hello Config : SQL 2000 on WIN 2000 (IIS 5.0) In my ASP page for some queries i have this error : Microsoft OLE DB Provider for SQL Server error '80040e31' Timeout expired
3
by: jynxxxed | last post by:
I've been reviewing some of the threads here and applying some of the advice and still getting the same error. 15:50:26,935 INFO java.sql.SQLException: Could not find stored procedure...
0
by: mirandacascade | last post by:
Questions toward the bottom of the post. Situation is this: 1) Access 97 2) SQL Server 2000 3) The Access app: a) sets up pass-thru query b) .SQL property of querydef is a string, the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.