Calling BeginTrans without Commit / RollBack

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Will there be any negative impact (subtle issue) on the database if one
calls SqlConnection.BeginTransaction but not SqlTransaction.Commit or
SqlTransaction.Rollback afterward?

I am talking about the case where it's imposible to issue the
commit/rollback commands, e.g. a sudden blackout.


Thanks in advance,

Akano
 
If there is a black out, and the PC running the executable shuts off, I
think sql server should rollback the transaction itself and release any
locks acquired by the transaction. This works if just running an exe that
starts a transaction, never finishes, and the executable completes - nothing
done by the unfinished transaction is committed, and no locks left on the
database.
 
That is correct, rollback is guaranteed

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/
 
But not immediately .. right?

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/


Angel Saenz-Badillos said:
That is correct, rollback is guaranteed

--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/




Marina said:
If there is a black out, and the PC running the executable shuts off, I
think sql server should rollback the transaction itself and release any
locks acquired by the transaction. This works if just running an exe that
starts a transaction, never finishes, and the executable completes -
nothing done by the unfinished transaction is committed, and no locks
left on the database.
 
Back
Top