Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why a programs first fails for locks and then succeeds ?

Status
Not open for further replies.

parbhani

Technical User
Jul 3, 2002
125
GB
Hi All ,

I have a strange problem.

There 2 programs, which run one after the another, once a day. First one inserts records in a table ( may be between 3000 to 5000 records each day ) and another update on the table.

The second program which updates, starts running immediatly after first is finished.

The second program fails every day. We re-start it, when we notice the failure and it runs successfully then !!
When it fails, it fails with error,
"1204 2 17,SQL Server has run out of LOCKS. Re-run your command when there are fewer active users, or contact a user with System Administrator (SA) role to reconfigure SQL Server with more LOCKS".

This is happening since last 3-4 weeks.

I am assumming that we are running out of memory or locks here. But, then, why success in the second run ?
If I say that, it has to do something with the previous job, which has taken locks (Its a big table with around 200000 rows and 5 indexes ) during the insert and before it has released all locks and resources, we are running the second job. Am I very worng in saying that ? Index rebalancing or something like that ?

Please suggest.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top