Reuse Transaction?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

after committing a transaction I'd like to create a new transaction on an existing connection. However, this doesn't seem to work.

Here's some pseudo code I'm using

using (SqlConnection con = new SqlConnection())
{
SqlTransaction trans = con.BeginTransaction();
...
trans.Commit();
trans = con.BeginTransaction(); // this throws an exception
}

Can someone please enlighten me on why this throws an exception?

TIA,
www.axeldahmen.de
Axel Dahmen
.



Relevant Pages

  • Re: Working Transactions somehow started not to work
    ... Transaction and locking are not properties of recordsets but are properties ... Opening a served-based cursor will put a lock on ... If a connection is closed, ... SL> and are not associated necessarily with server-based cursors. ...
    (microsoft.public.access.adp.sqlserver)
  • Setting Locks on Rows in MSSQL Database (Currenlty Unsolvable Problem and Trying)
    ... I am beginning a transaction from PHP and setting a lock on a record ... I then commit the transaction I started when the user clicked ... There is no way in PHP where I can start a persistent ms sql connection ...
    (alt.php)
  • TransactionScope Transactions not commiting
    ... be) using the same SQL Connection. ... and dtermines the Connection String to use to create the connection to ... MyClass obj = new MyClass; ... not involved in a Transaction. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Driver AutoCommit issue
    ... Isn't the XA driver for the distributed transaction, I need to install the path sqljdbc_xa.dll and xa_install.sql before using the XA driver. ... I created a TX aware datasource using com.microsoft.sqlserver.jdbc.SQLServerDriver and tried to get the connection from the TX aware data source. ... I set the auto commit to false on connection as soon as I get the connection from the datasoruce. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Oracle distributed transaction
    ... > Connections are drawn from the pool and assigned based on transaction ... The context of the requesting thread and the assigned connection> must match. ... Therefore, each connection pool is actually subdivided into> connections with no transaction context associated with them, and into N> subdivisions that each contain connections with a particular transaction> context. ... This allows you to commit or abort the> distributed transaction at a later time. ...
    (microsoft.public.dotnet.framework.adonet)