468,107 Members | 1,301 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

MS -SQL Server 2000 -connection closes randomly

Hi,

We have some console application which runs in background with the
following logical flow :
Main()
{
loop (1..n)
{
CreateThread(Function1)
}
}

Function1()
{
Open SQLConnection;
Loop Till No Data Found
{
Fetch N Records;
For Each of N Records
{
Begin Transaction;
Do DB Activity on the current record (Update);
If Last operation Failed
{
DB Rollback;
break;
}
If CommitFrequency reached
{
DB Commit;
}
}
}
Close SQLConnection;
}

After successfully executing some random number of records, the
connection object is abruptly closing (In the line marked RED). It is
giving "Connection Closed" exception on ExecuteQuery() call. Sometimes
it is giving "Reader is already closed" while doing any Get()
operation on the SQLReader object.

We are using
VS.Net 1.0 with SP4
SQLServer 2000(no SPs)

1) We are making a direct call to SQL server from the App Layer and
not
using COM+ .. to maintain transactions. Transactions are maintained
purely by the Conn transaction Object.

2) We have not specified any TimeOut property in the ConnectionString.
(Anyway also tried giving a huge value just for testing).
Is there any default timeout that is there in MS SQL and if yes how to
offset it?

Thanks
Rings
Jul 20 '05 #1
0 1286

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by tangokilo | last post: by
6 posts views Thread by Todd Brewer | last post: by
1 post views Thread by finn clement hansen | last post: by
1 post views Thread by Vikram S | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.