[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

How to handle TimeOut Expired Error Message

Pradeep

3/29/2007 5:42:00 AM

Hello,
0
Not sure if this question fits into this group or not. Please let me know if
it does not so that I can post it in the Vb6 group.

I have built an application with VB6.0 and SQL Server 2000. When i Execute a
stored procedure, it fails at times with a Time Out Expired message. After i
receive that message i am not able to execute any other stored procedure
which usually execute without any problems. Once i encounter the message,
attempts to execute all other stored procedures return the same error.

out of sheer curiosity, I closed the connection, set the object to Nothing
and reopened it when everything started working. Is there anything that i can
set in the connection string itself. I tried setting the Time Out property in
the properties window of the SQL Server but i do not access to the same.

Any ideas of implementing the same would be highly appreciated.

Cheers,

Pradeep
6 Answers

Uri Dimant

3/29/2007 6:29:00 AM

0

Hi

First of all , you have to optimize your SP. That is the main problem
Secondly , specify in connection string (within VB) timeout=0


"Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
news:70EC32AF-FF37-4060-AD28-088E7D28B77C@microsoft.com...
> Hello,
> 0
> Not sure if this question fits into this group or not. Please let me know
> if
> it does not so that I can post it in the Vb6 group.
>
> I have built an application with VB6.0 and SQL Server 2000. When i Execute
> a
> stored procedure, it fails at times with a Time Out Expired message. After
> i
> receive that message i am not able to execute any other stored procedure
> which usually execute without any problems. Once i encounter the message,
> attempts to execute all other stored procedures return the same error.
>
> out of sheer curiosity, I closed the connection, set the object to Nothing
> and reopened it when everything started working. Is there anything that i
> can
> set in the connection string itself. I tried setting the Time Out property
> in
> the properties window of the SQL Server but i do not access to the same.
>
> Any ideas of implementing the same would be highly appreciated.
>
> Cheers,
>
> Pradeep


Pradeep

3/29/2007 8:50:00 AM

0

Thanks Uri,

I am looking at what could be wrong in the stored procedure,I will certainly
include the statement in the connection string.

I am using BEGIN TRANSACTION "X" <statements> COMMIT TRANSACTION "X"

Does the above syntax in any way lock the table and cause the error.

Thanks for all the help.

Cheers,

Pradeep

"Uri Dimant" wrote:

> Hi
>
> First of all , you have to optimize your SP. That is the main problem
> Secondly , specify in connection string (within VB) timeout=0
>
>
> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
> news:70EC32AF-FF37-4060-AD28-088E7D28B77C@microsoft.com...
> > Hello,
> > 0
> > Not sure if this question fits into this group or not. Please let me know
> > if
> > it does not so that I can post it in the Vb6 group.
> >
> > I have built an application with VB6.0 and SQL Server 2000. When i Execute
> > a
> > stored procedure, it fails at times with a Time Out Expired message. After
> > i
> > receive that message i am not able to execute any other stored procedure
> > which usually execute without any problems. Once i encounter the message,
> > attempts to execute all other stored procedures return the same error.
> >
> > out of sheer curiosity, I closed the connection, set the object to Nothing
> > and reopened it when everything started working. Is there anything that i
> > can
> > set in the connection string itself. I tried setting the Time Out property
> > in
> > the properties window of the SQL Server but i do not access to the same.
> >
> > Any ideas of implementing the same would be highly appreciated.
> >
> > Cheers,
> >
> > Pradeep
>
>
>

Uri Dimant

3/29/2007 9:24:00 AM

0

Hi

When you specify BEGIN TRAN .... that means all DML will be ran as one
transaction and depends on what are your DML users may wait till transaction
will be commited


"Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
news:563A297C-911A-4CC5-9721-EA914B447284@microsoft.com...
> Thanks Uri,
>
> I am looking at what could be wrong in the stored procedure,I will
> certainly
> include the statement in the connection string.
>
> I am using BEGIN TRANSACTION "X" <statements> COMMIT TRANSACTION "X"
>
> Does the above syntax in any way lock the table and cause the error.
>
> Thanks for all the help.
>
> Cheers,
>
> Pradeep
>
> "Uri Dimant" wrote:
>
>> Hi
>>
>> First of all , you have to optimize your SP. That is the main problem
>> Secondly , specify in connection string (within VB) timeout=0
>>
>>
>> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
>> news:70EC32AF-FF37-4060-AD28-088E7D28B77C@microsoft.com...
>> > Hello,
>> > 0
>> > Not sure if this question fits into this group or not. Please let me
>> > know
>> > if
>> > it does not so that I can post it in the Vb6 group.
>> >
>> > I have built an application with VB6.0 and SQL Server 2000. When i
>> > Execute
>> > a
>> > stored procedure, it fails at times with a Time Out Expired message.
>> > After
>> > i
>> > receive that message i am not able to execute any other stored
>> > procedure
>> > which usually execute without any problems. Once i encounter the
>> > message,
>> > attempts to execute all other stored procedures return the same error.
>> >
>> > out of sheer curiosity, I closed the connection, set the object to
>> > Nothing
>> > and reopened it when everything started working. Is there anything that
>> > i
>> > can
>> > set in the connection string itself. I tried setting the Time Out
>> > property
>> > in
>> > the properties window of the SQL Server but i do not access to the
>> > same.
>> >
>> > Any ideas of implementing the same would be highly appreciated.
>> >
>> > Cheers,
>> >
>> > Pradeep
>>
>>
>>


Uri Dimant

3/29/2007 12:25:00 PM

0

Hari

> Please do not enclose multiple commands inside one transaction if it is
> OLTP system as well as make sure that table has proper indexes.

Sometimes you cannot avoid it. Like having SELECT @val=MAX(col)...... and
then UPDATE .... SET col=@val
The OP has to make sure that inside BEGIN TRAN.. block he needs to no mix
up DML and first SELECT statemens and later on UPDATE/INSERT/DELETE as
well as order tables that participate with DML.





"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
news:%23t1I1xfcHHA.3976@TK2MSFTNGP06.phx.gbl...
> Hello Pradeep,
>
> Please do not enclose multiple commands inside one transaction if it is
> OLTP system as well as make sure that table has proper indexes.
> What ever records used inside this tranactgion will be locked and other
> sessions needs to wait for the same data until the end of transaction
> is completed. So if other processes tries the same data there are chances
> for lot of wait_time and causes application time out.
>
> Thanks
> Hari
>
> "Uri Dimant" <urid@iscar.co.il> wrote in message
> news:u1BfjQecHHA.3648@TK2MSFTNGP05.phx.gbl...
>> Hi
>>
>> When you specify BEGIN TRAN .... that means all DML will be ran as one
>> transaction and depends on what are your DML users may wait till
>> transaction will be commited
>>
>>
>> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
>> news:563A297C-911A-4CC5-9721-EA914B447284@microsoft.com...
>>> Thanks Uri,
>>>
>>> I am looking at what could be wrong in the stored procedure,I will
>>> certainly
>>> include the statement in the connection string.
>>>
>>> I am using BEGIN TRANSACTION "X" <statements> COMMIT TRANSACTION "X"
>>>
>>> Does the above syntax in any way lock the table and cause the error.
>>>
>>> Thanks for all the help.
>>>
>>> Cheers,
>>>
>>> Pradeep
>>>
>>> "Uri Dimant" wrote:
>>>
>>>> Hi
>>>>
>>>> First of all , you have to optimize your SP. That is the main problem
>>>> Secondly , specify in connection string (within VB) timeout=0
>>>>
>>>>
>>>> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
>>>> news:70EC32AF-FF37-4060-AD28-088E7D28B77C@microsoft.com...
>>>> > Hello,
>>>> > 0
>>>> > Not sure if this question fits into this group or not. Please let me
>>>> > know
>>>> > if
>>>> > it does not so that I can post it in the Vb6 group.
>>>> >
>>>> > I have built an application with VB6.0 and SQL Server 2000. When i
>>>> > Execute
>>>> > a
>>>> > stored procedure, it fails at times with a Time Out Expired message.
>>>> > After
>>>> > i
>>>> > receive that message i am not able to execute any other stored
>>>> > procedure
>>>> > which usually execute without any problems. Once i encounter the
>>>> > message,
>>>> > attempts to execute all other stored procedures return the same
>>>> > error.
>>>> >
>>>> > out of sheer curiosity, I closed the connection, set the object to
>>>> > Nothing
>>>> > and reopened it when everything started working. Is there anything
>>>> > that i
>>>> > can
>>>> > set in the connection string itself. I tried setting the Time Out
>>>> > property
>>>> > in
>>>> > the properties window of the SQL Server but i do not access to the
>>>> > same.
>>>> >
>>>> > Any ideas of implementing the same would be highly appreciated.
>>>> >
>>>> > Cheers,
>>>> >
>>>> > Pradeep
>>>>
>>>>
>>>>
>>
>>
>
>


Hari

3/29/2007 1:18:00 PM

0

Hello Pradeep,

Please do not enclose multiple commands inside one transaction if it is
OLTP system as well as make sure that table has proper indexes.
What ever records used inside this tranactgion will be locked and other
sessions needs to wait for the same data until the end of transaction
is completed. So if other processes tries the same data there are chances
for lot of wait_time and causes application time out.

Thanks
Hari

"Uri Dimant" <urid@iscar.co.il> wrote in message
news:u1BfjQecHHA.3648@TK2MSFTNGP05.phx.gbl...
> Hi
>
> When you specify BEGIN TRAN .... that means all DML will be ran as one
> transaction and depends on what are your DML users may wait till
> transaction will be commited
>
>
> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
> news:563A297C-911A-4CC5-9721-EA914B447284@microsoft.com...
>> Thanks Uri,
>>
>> I am looking at what could be wrong in the stored procedure,I will
>> certainly
>> include the statement in the connection string.
>>
>> I am using BEGIN TRANSACTION "X" <statements> COMMIT TRANSACTION "X"
>>
>> Does the above syntax in any way lock the table and cause the error.
>>
>> Thanks for all the help.
>>
>> Cheers,
>>
>> Pradeep
>>
>> "Uri Dimant" wrote:
>>
>>> Hi
>>>
>>> First of all , you have to optimize your SP. That is the main problem
>>> Secondly , specify in connection string (within VB) timeout=0
>>>
>>>
>>> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
>>> news:70EC32AF-FF37-4060-AD28-088E7D28B77C@microsoft.com...
>>> > Hello,
>>> > 0
>>> > Not sure if this question fits into this group or not. Please let me
>>> > know
>>> > if
>>> > it does not so that I can post it in the Vb6 group.
>>> >
>>> > I have built an application with VB6.0 and SQL Server 2000. When i
>>> > Execute
>>> > a
>>> > stored procedure, it fails at times with a Time Out Expired message.
>>> > After
>>> > i
>>> > receive that message i am not able to execute any other stored
>>> > procedure
>>> > which usually execute without any problems. Once i encounter the
>>> > message,
>>> > attempts to execute all other stored procedures return the same error.
>>> >
>>> > out of sheer curiosity, I closed the connection, set the object to
>>> > Nothing
>>> > and reopened it when everything started working. Is there anything
>>> > that i
>>> > can
>>> > set in the connection string itself. I tried setting the Time Out
>>> > property
>>> > in
>>> > the properties window of the SQL Server but i do not access to the
>>> > same.
>>> >
>>> > Any ideas of implementing the same would be highly appreciated.
>>> >
>>> > Cheers,
>>> >
>>> > Pradeep
>>>
>>>
>>>
>
>


Roger Wolter[MSFT]

3/30/2007 4:08:00 AM

0

Wow, that's one of the most dangerous statements I've seen in a while.
Transactions are there to enforce data integrity which most people will
agree is more important than performance. I can see a DBA going into the
bank president "the good news is our system is 20% faster. The bad news is
you can expect to randomly have money disappear from accounts in an
undetectable manner." I know what decision I would want my banker to make.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cp...

"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
news:%23t1I1xfcHHA.3976@TK2MSFTNGP06.phx.gbl...
> Hello Pradeep,
>
> Please do not enclose multiple commands inside one transaction if it is
> OLTP system as well as make sure that table has proper indexes.
> What ever records used inside this tranactgion will be locked and other
> sessions needs to wait for the same data until the end of transaction
> is completed. So if other processes tries the same data there are chances
> for lot of wait_time and causes application time out.
>
> Thanks
> Hari
>
> "Uri Dimant" <urid@iscar.co.il> wrote in message
> news:u1BfjQecHHA.3648@TK2MSFTNGP05.phx.gbl...
>> Hi
>>
>> When you specify BEGIN TRAN .... that means all DML will be ran as one
>> transaction and depends on what are your DML users may wait till
>> transaction will be commited
>>
>>
>> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
>> news:563A297C-911A-4CC5-9721-EA914B447284@microsoft.com...
>>> Thanks Uri,
>>>
>>> I am looking at what could be wrong in the stored procedure,I will
>>> certainly
>>> include the statement in the connection string.
>>>
>>> I am using BEGIN TRANSACTION "X" <statements> COMMIT TRANSACTION "X"
>>>
>>> Does the above syntax in any way lock the table and cause the error.
>>>
>>> Thanks for all the help.
>>>
>>> Cheers,
>>>
>>> Pradeep
>>>
>>> "Uri Dimant" wrote:
>>>
>>>> Hi
>>>>
>>>> First of all , you have to optimize your SP. That is the main problem
>>>> Secondly , specify in connection string (within VB) timeout=0
>>>>
>>>>
>>>> "Pradeep" <Pradeep@discussions.microsoft.com> wrote in message
>>>> news:70EC32AF-FF37-4060-AD28-088E7D28B77C@microsoft.com...
>>>> > Hello,
>>>> > 0
>>>> > Not sure if this question fits into this group or not. Please let me
>>>> > know
>>>> > if
>>>> > it does not so that I can post it in the Vb6 group.
>>>> >
>>>> > I have built an application with VB6.0 and SQL Server 2000. When i
>>>> > Execute
>>>> > a
>>>> > stored procedure, it fails at times with a Time Out Expired message.
>>>> > After
>>>> > i
>>>> > receive that message i am not able to execute any other stored
>>>> > procedure
>>>> > which usually execute without any problems. Once i encounter the
>>>> > message,
>>>> > attempts to execute all other stored procedures return the same
>>>> > error.
>>>> >
>>>> > out of sheer curiosity, I closed the connection, set the object to
>>>> > Nothing
>>>> > and reopened it when everything started working. Is there anything
>>>> > that i
>>>> > can
>>>> > set in the connection string itself. I tried setting the Time Out
>>>> > property
>>>> > in
>>>> > the properties window of the SQL Server but i do not access to the
>>>> > same.
>>>> >
>>>> > Any ideas of implementing the same would be highly appreciated.
>>>> >
>>>> > Cheers,
>>>> >
>>>> > Pradeep
>>>>
>>>>
>>>>
>>
>>
>
>