473,394 Members | 1,841 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,394 software developers and data experts.

Supress timeout for long call to a database.

Lokean
71
my vb.net program hits a SQL server database where the query can take as much as four hours to run.

Right now, it times out on the vb.net side after only 30 seconds.

my call to the database is through a tablehandler.

If V.sSerialNum Is Nothing Then
s.FillAllErrByModel(t, V.sStartDate, V.sEndDate, V.sModel, V.sProduct)

end if

I would much appreciate it if someone could tell me
1)What code to use to extend the timeout time to 4 hours
2)where to place it

thank you.
Jun 5 '07 #1
9 2339
Plater
7,872 Expert 4TB
There is a timeout statement in your conenction string (well I think it's optional so you might not have it, check for it and change it)

But WOW 4 hours!! 40seconds is considered to be too ridiculously long and you need re-think how you do things. I cannot imagine waiting 4 hours.
Jun 5 '07 #2
Lokean
71
There is a timeout statement in your conenction string (well I think it's optional so you might not have it, check for it and change it)

But WOW 4 hours!! 40seconds is considered to be too ridiculously long and you need re-think how you do things. I cannot imagine waiting 4 hours.
Yeah,

I'm not the DBA, just the poor sod that has to hit the database...

I did a search through my project and didn't find the timeout statement.

Where would I insert it?
Jun 5 '07 #3
Plater
7,872 Expert 4TB
It goes in your SqlCommand.CommandTimeout
Jun 5 '07 #4
nateraaaa
663 Expert 512MB
The Command Timeout is calculated in seconds so if you need to assign the timeout to 4 hours you will need to do 60 seconds X 60 minutes X 4 to get the correct number of seconds to set the timeout for.

Nathan
Jun 5 '07 #5
Lokean
71
Thanks.

but now it's telling me that the commandtimeout property is "Read only"

How do I reset it?
Jun 5 '07 #6
Plater
7,872 Expert 4TB
Mine isn't read only...
what object are you using?
SqlCommand?
SqlDataAdapter?
Jun 5 '07 #7
LacrosseB0ss
113 100+
I believe this property is in the actual database or application settings if I remember correctly. We were having issues with connections being opened and not closing and slowing down our servers. I want to say your .config file but I'm not sure if that's right.

The file I remember seeing was an XML file or something similar that showed all properties for everything (Apache, SqlServer, ASP, PHP, etc) and they all had different values. I think this is the file where you can change that if anyone knows what it's called.

As an aside, I'm with the other poster. 4 hours?!?! The default is a minute I think. And when I was working on the aforementioned (php) app the connections were alive on the server for 2 hours. At the beginning of the day everything was fine but around lunch it would timeout. 4 hours is a bit excessive and will lead to problems.

Hope this helps;
- LB
Jun 5 '07 #8
Lokean
71
Mine isn't read only...
what object are you using?
SqlCommand?
SqlDataAdapter?


Here's what I'm using

Dim t As New analyticsDataSet.dfGetErrors_TypeDataTable
Dim s As New analyticsDataSetTableAdapters.dfGetErrors_TypeTabl eAdapter

when I try:

s.Connection.ConnectionTimeout = 1500

I get Property 'ConnectionTimeout' is 'ReadOnly'.
Jun 5 '07 #9
Plater
7,872 Expert 4TB
Here's what I'm using

Dim t As New analyticsDataSet.dfGetErrors_TypeDataTable
Dim s As New analyticsDataSetTableAdapters.dfGetErrors_TypeTabl eAdapter

when I try:

s.Connection.ConnectionTimeout = 1500

I get Property 'ConnectionTimeout' is 'ReadOnly'.
CommandTimeout not ConnectionTimeout
(ConectionTimeout is set in connectionstring)
CommandTimeout is set in your SqlCommand (or SqlDataAdapter.SelectCommand) object
Jun 5 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: HolaGoogle | last post by:
hi all, can you please tell me what i should do to avoid session timeout when displaying my database info in my asp form (DisplayUserDatabase.asp)??? ** actualy it does load and display the...
4
by: Ram Baruch | last post by:
Hi, I have a question: I made a windows service (using VS wizard). All it does is to connect to my site every X seconds and check if there is anything new to download. If there is- it downloads a...
1
by: ArunPrakash | last post by:
Hi, I want to implement a method which will poll database for messages. But i want to provide a method that will specify a timeout until which it will be polled and after that it will throw an...
4
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" &...
2
by: Solel Software | last post by:
Hello I have a SQL Server 2000 database query that takes a long time (about 1.5 min in SQL Query Analyser) that I am running from a web page. I keep getting a Timeout error regardless of how long...
10
by: greenb | last post by:
Our asp.net web app uses a .NET component (DLL) in the bin directory to call several stored procedures back to back to perform updates. They don't return any data. Sometimes the total execution...
2
by: Chakravarti Mukesh | last post by:
Hi all, I have put some queries on the page that takes too much time to execute. Thus at the time of peak load it gives the following error. Server Error in '/ge' Application....
4
by: James | last post by:
How can I see/set the timeout for a postback? I have a button click event which loops through a DataSet and calls a stored procedure for every record in the dataset. This can be a very large...
22
by: Nick Craig-Wood | last post by:
Did anyone write a contextmanager implementing a timeout for python2.5? I'd love to be able to write something like with timeout(5.0) as exceeded: some_long_running_stuff() if exceeded:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.