Showing posts with label timeout. Show all posts
Showing posts with label timeout. Show all posts

Friday, March 23, 2012

How to setup LockTime value?

When I set the deadlock timeout value by "set @.@.lock_timeout", if I log off
from the server, the value will be set to the default value "-1".
How to set up the value, which can be applied where the server start up?
Thanks.
AlistairLock timeout can not be set that way... sorry...( and do not remember any
Trace flags which allow it to be set for all users either.)
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Alistair" <anonymous@.discussions.microsoft.com> wrote in message
news:6D258EAB-7A0F-44D6-AB4A-DFEB1D7EE74E@.microsoft.com...
quote:

> When I set the deadlock timeout value by "set @.@.lock_timeout", if I log

off from the server, the value will be set to the default value "-1".
quote:

> How to set up the value, which can be applied where the server start up?
> Thanks.
> Alistair
sql

How to setup LockTime value?

When I set the deadlock timeout value by "set @.@.lock_timeout", if I log off from the server, the value will be set to the default value "-1".
How to set up the value, which can be applied where the server start up?
Thanks.
AlistairLock timeout can not be set that way... sorry...( and do not remember any
Trace flags which allow it to be set for all users either.)
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Alistair" <anonymous@.discussions.microsoft.com> wrote in message
news:6D258EAB-7A0F-44D6-AB4A-DFEB1D7EE74E@.microsoft.com...
> When I set the deadlock timeout value by "set @.@.lock_timeout", if I log
off from the server, the value will be set to the default value "-1".
> How to set up the value, which can be applied where the server start up?
> Thanks.
> Alistair

Monday, March 19, 2012

How to set transactions timeout?

Is there a way for a client to tell a server to rollback a transaction after a certain time elapses?

The scenario: I execute an update statement in a RepeatableRead transaction, but the client may lose network connectivity before the Commit is issued. If this occurs after ExecuteNonQuery, then the process on the sql server is holding a large amount of locks, and the server takes several minutes before it releases those locks.

Meanwhile, other transactions are attempting to run, but are getting selected as the deadlock victims because they are waiting on resources that the disconnected client had locked. This really backs things up.

I have found some settings that can be done on the server side that will decrease the time it takes for a transaction WAITING on resources to timeout. I.E. this just makes those that are being blocked timeout faster. But it is the blockING process that I want rolledback sooner. It doesn't get selected as the deadlock victim because it has all the resources it needs. It is not waiting on any resources, but instead the server is simply waiting for another query or a commit, which it never gets because the client lost network connectivity. The command timeout doesn't seem to have an affect, because the command itself completes.

I tested this by having a client display a modal dialog box just before the commit statement, and then I unplugged the network cable. I then used activity monitor on the server to view the locks being held. I refreshed it several times, and I believe at least 5 minutes pasted before the locks were released.

In the production environment, users will be losing connectivity very often. I'm sure someone will suggest a different architecture where the database logic is server side, and data is sent to/from clients in another manner so that this situation can be handled by the server side app. Right now that is not an option. I am running the database in 2000, but sql server 2005 with 2000 compatibility mode is also possible.

Thanks in advance.

If you are using distributed transactions, the timeout can be configured via Control Panel->Administrative Tools->Component Services.

See also http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=772404&SiteID=1

|||I'm not using distributed transactions unless that's the default for ADO.NET, but I'll read up on them and see if maybe that's what I should use. Thanks.

How to set transactions timeout?

Is there a way for a client to tell a server to rollback a transaction after a certain time elapses?

The scenario: I execute an update statement in a RepeatableRead transaction, but the client may lose network connectivity before the Commit is issued. If this occurs after ExecuteNonQuery, then the process on the sql server is holding a large amount of locks, and the server takes several minutes before it releases those locks.

Meanwhile, other transactions are attempting to run, but are getting selected as the deadlock victims because they are waiting on resources that the disconnected client had locked. This really backs things up.

I have found some settings that can be done on the server side that will decrease the time it takes for a transaction WAITING on resources to timeout. I.E. this just makes those that are being blocked timeout faster. But it is the blockING process that I want rolledback sooner. It doesn't get selected as the deadlock victim because it has all the resources it needs. It is not waiting on any resources, but instead the server is simply waiting for another query or a commit, which it never gets because the client lost network connectivity. The command timeout doesn't seem to have an affect, because the command itself completes.

I tested this by having a client display a modal dialog box just before the commit statement, and then I unplugged the network cable. I then used activity monitor on the server to view the locks being held. I refreshed it several times, and I believe at least 5 minutes pasted before the locks were released.

In the production environment, users will be losing connectivity very often. I'm sure someone will suggest a different architecture where the database logic is server side, and data is sent to/from clients in another manner so that this situation can be handled by the server side app. Right now that is not an option. I am running the database in 2000, but sql server 2005 with 2000 compatibility mode is also possible.

Thanks in advance.

If you are using distributed transactions, the timeout can be configured via Control Panel->Administrative Tools->Component Services.

See also http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=772404&SiteID=1

|||I'm not using distributed transactions unless that's the default for ADO.NET, but I'll read up on them and see if maybe that's what I should use. Thanks.

How to set the Timeout and Timeoutspecified property?

Hi all
We are getting a 'Operation Timedout' error when trying to render a report
as pdf. Will setting the Timeout and Timeoutspecified property will help
resolve this issue. Based on some criteria this report can take long time.
Also I cant find how to set the timeout and timeoutspecified property?
Please help
Thanks
RahulI think for a report you can set the timeout in the report
manager.
>--Original Message--
>Hi all
>We are getting a 'Operation Timedout' error when trying
to render a report
>as pdf. Will setting the Timeout and Timeoutspecified
property will help
>resolve this issue. Based on some criteria this report
can take long time.
>Also I cant find how to set the timeout and
timeoutspecified property?
>Please help
>Thanks
>Rahul
>
>.
>

Monday, March 12, 2012

How to set SQLCommand timeout for SqlDataSource for ASP.NET 2.0?

With VS2005, there is a new component SqlDataSource,

<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>

Then you can assign SP and bind datasource to a get data for this component in .NET code:

SqlDataSource1.SelectCommand = "spName"
SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.StoredProcedure
SqlDataSource1.ConnectionString = Comm.connString

There is no way to set sqlcommand timeout for this stored procedure like SqlClient.SqlCommand. How can I do this?

Inside the SqlDataSource1_Selecting event, you get access to the sqlcommand object via e.command. You can set the commandtimeout on it there, like:

e.Command.CommandTimeout=300

|||

Thanks for your reply. But when is the event Selecting fired? Is it fired automatically when binding to data source?

|||

Hi KentZhou,

The sqldatasource.selecting event happends right before your perform a data retrieval opteration(where you execute your select command).You can refer to the msdn explaination:

msdn:

Occurs before a data retrieval operation.

Handle theSelecting event to perform additional initialization operations that are specific to your application, to validate the values of parameters, or to change the parameter values before theSqlDataSource control performs the select operation. The select arguments are available from theSqlDataSourceSelectingEventArgs object that is associated with the event.

Hope my suggestion helps

|||

The short answer is "Yes".

It fires any time that you do a databind.

The long answer as described above, it actually happens any time that the SqlDatasource is about to go and execute your select command. This is normally done through a databinding operation (Either implied or programmatically triggered), however it can also be triggered if you call the select method on the SqlDatasource directly.

Friday, March 9, 2012

How to set Report manager PDF export timeout?

In the report manager you have the option to export to PDF which pops up a
windows that has a timeout encoded into the URL that generates the PDF. The
URL generated looks like:
http://localhost/Reports/Reserved.ReportViewerWebControl.axd?Server=http%3a%2f%2flocalhost%2fReportServer&Timeout=100000&ReportSession=ayxrhe45b5gzjh55mcra5o45&ControlID=18a6c1bb-379f-4332-9b44-16aa3eb2468b&OpType=Export&Format=PDF
I'm pretty sure it's this hardcoded value in the URL because when I increase
it; it works. Is there any way to configure this? I searched the web but I
haven't seen this addressed anywhere.
Windows 2003 server -
SQL Server April 2005 CTPAny ideas on this...
Is there no way to increase this timeout? Can Microsoft maybe add a
configuration setting into the 2005 version so this can be set in the config
file? It seems like an easy request since someone hardcoded the default to
100000.
Thanks,
Jeff
"Jeff Glenn" wrote:
> In the report manager you have the option to export to PDF which pops up a
> windows that has a timeout encoded into the URL that generates the PDF. The
> URL generated looks like:
> http://localhost/Reports/Reserved.ReportViewerWebControl.axd?Server=http%3a%2f%2flocalhost%2fReportServer&Timeout=100000&ReportSession=ayxrhe45b5gzjh55mcra5o45&ControlID=18a6c1bb-379f-4332-9b44-16aa3eb2468b&OpType=Export&Format=PDF
> I'm pretty sure it's this hardcoded value in the URL because when I increase
> it; it works. Is there any way to configure this? I searched the web but I
> haven't seen this addressed anywhere.
> Windows 2003 server -
> SQL Server April 2005 CTP

Wednesday, March 7, 2012

How to set default SQL Timeout

I have an app that uses ADO connections, and when I run a particular
operation I get a SQL Timeout, but when I run the same operation with the
same executable on another client I don't get a timeout. A Profiler trace
confirms that the first query times out after 30 seconds (the default), and
the second client succeeds after about 40 seconds. Both clients are running
the same MDAC version.
I thought that the query timeout is set in the ADO command object, but this
behavior leads me to think otherwise. Is there a way to set the default
timeout value on a client?
Thanks,
Tom
Well, I've partially explained my own problem. The client that isn't timing
out is running on the server using the shared memory protocol LPC. When I
disable that and force the connection to use TCP/IP or named pipes, then I
get the SQL Timeout. So now my question is why is there a different timeout
value for TCP/IP and named pipe connections than there is for shared memory
connections?
Tom
"Tom" wrote:

> I have an app that uses ADO connections, and when I run a particular
> operation I get a SQL Timeout, but when I run the same operation with the
> same executable on another client I don't get a timeout. A Profiler trace
> confirms that the first query times out after 30 seconds (the default), and
> the second client succeeds after about 40 seconds. Both clients are running
> the same MDAC version.
> I thought that the query timeout is set in the ADO command object, but this
> behavior leads me to think otherwise. Is there a way to set the default
> timeout value on a client?
> Thanks,
> Tom

How to set default SQL Timeout

I have an app that uses ADO connections, and when I run a particular
operation I get a SQL Timeout, but when I run the same operation with the
same executable on another client I don't get a timeout. A Profiler trace
confirms that the first query times out after 30 seconds (the default), and
the second client succeeds after about 40 seconds. Both clients are running
the same MDAC version.
I thought that the query timeout is set in the ADO command object, but this
behavior leads me to think otherwise. Is there a way to set the default
timeout value on a client?
Thanks,
TomWell, I've partially explained my own problem. The client that isn't timing
out is running on the server using the shared memory protocol LPC. When I
disable that and force the connection to use TCP/IP or named pipes, then I
get the SQL Timeout. So now my question is why is there a different timeout
value for TCP/IP and named pipe connections than there is for shared memory
connections?
Tom
"Tom" wrote:

> I have an app that uses ADO connections, and when I run a particular
> operation I get a SQL Timeout, but when I run the same operation with the
> same executable on another client I don't get a timeout. A Profiler trace
> confirms that the first query times out after 30 seconds (the default), an
d
> the second client succeeds after about 40 seconds. Both clients are runni
ng
> the same MDAC version.
> I thought that the query timeout is set in the ADO command object, but thi
s
> behavior leads me to think otherwise. Is there a way to set the default
> timeout value on a client?
> Thanks,
> Tom

How to set default SQL Timeout

I have an app that uses ADO connections, and when I run a particular
operation I get a SQL Timeout, but when I run the same operation with the
same executable on another client I don't get a timeout. A Profiler trace
confirms that the first query times out after 30 seconds (the default), and
the second client succeeds after about 40 seconds. Both clients are running
the same MDAC version.
I thought that the query timeout is set in the ADO command object, but this
behavior leads me to think otherwise. Is there a way to set the default
timeout value on a client?
Thanks,
TomWell, I've partially explained my own problem. The client that isn't timing
out is running on the server using the shared memory protocol LPC. When I
disable that and force the connection to use TCP/IP or named pipes, then I
get the SQL Timeout. So now my question is why is there a different timeout
value for TCP/IP and named pipe connections than there is for shared memory
connections?
Tom
"Tom" wrote:
> I have an app that uses ADO connections, and when I run a particular
> operation I get a SQL Timeout, but when I run the same operation with the
> same executable on another client I don't get a timeout. A Profiler trace
> confirms that the first query times out after 30 seconds (the default), and
> the second client succeeds after about 40 seconds. Both clients are running
> the same MDAC version.
> I thought that the query timeout is set in the ADO command object, but this
> behavior leads me to think otherwise. Is there a way to set the default
> timeout value on a client?
> Thanks,
> Tom