Watch Named, Nested Transactions

Gail Shaw finishes her outstanding series on transactions:

The error was thrown by the ROLLBACK statement. As such, the transaction is still open, the locks are held and the transaction log space can’t be reused. Unless the application that called this was checking for open transactions, that transaction could potentially be left open for quite some amount of time, causing blocking and/or the transaction log to grow.

It’s not just that someone in the future might call the code from another stored proc within a transaction, it’s also that it might be that the code is called from an application which started a transaction. Or called from SSIS which started a transaction. It’s very hard to ensure that code is never called from within an existing transaction

Read the whole thing.

Related Posts

SQL Server 2017 and Visual Studio 2017/2019 Installation Error

Hamish Watson walks us through an error which happens when you install SQL Server 2017 and Visual Studio 2019 in the “wrong” order: This blog post is about a situation that initially perplexed me – I was installing SQL Server 2017 onto a new DEMO machine – running Windows Server 2019. This install is one […]

Read More

dbatools and Error Handling

Shane O’Neill takes us through some of the error-handling dynamics available in dbatools: PowerShell errors normally contain useful information on what went wrong. With this information, the “what went wrong” can be fixed. That being said, if you are writing PowerShell scripts and not raising valid error messages then I highly advise you to go […]

Read More

Categories

December 2015
MTWTFSS
« Nov Jan »
 123456
78910111213
14151617181920
21222324252627
28293031