Exception: TransactionAlreadyOpenException
Posted by Gerhard Stephan on April 21st, 2008
The TransactionAlreadyOpenException will always be thrown if you try to open an already open transaction a second time. In a simple example this exception can be forced with the following code.
using (AdFactum.Data.ObjectMapper mapper = OBM.CreateMapper(Connection))
{
try
{
mapper.BeginTransaction();
mapper.BeginTransaction(); // Second try causes the exception
}
catch(Exception)
{
mapper.Commit();
throw;
}
}
