Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Stored proc Timing out halfway through - rolling back without transaction

$
0
0
Hi,We have a high volume database with 1000's of users and 1000's of procs. Our application enforces a 20 second timeout on all connections. We can't adjust the 20 seconds - this is a business rule.It sometimes happens that a proc does not complete within 20 seconds and then times out halfway though. This causes data inconsistency where 50% of the code was saved to the DB and 50% was not - seeing that a stored proc is not transactional and therefor does not roll back the code.We can't put the code in a TRANSACTION in order to roll back when a time out occurs, because this causes exclusive locks on the tables.So I guess my question is:Is it possible to undo/rollback all the code in a proc when a timeout occurs - without using a TRANSACTION?And if a TRANSACTION is the only way - how do I avoid the exclusive lock and blocks? Thanks,

Viewing all articles
Browse latest Browse all 3145

Trending Articles