Transaction Timeout

D

Dominik Amon

Hi there!

i have a strange problem, when using TransactionScope in .net 2.0. I get an
TransactionException with a timeout after a while, about half an hour. But i
set the Timeout manually to three hours.

Here is the stacktrace:
---

System.Transactions.TransactionException: The operation is not valid for the
state of the transaction. ---> System.TimeoutException: Transaction Timeout
--- End of inner exception stack trace ---
at
System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction
tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification,
Transaction atomicTransaction)
at
System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification
promotableSinglePhaseNotification)
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction
tx)
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction
transaction)
at
System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction
transaction)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject)
at
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at
InhouseWKOIT.Framework.DataAccess.DbConnectionScope.GetOpenConnection(DbProviderFactory
factory, String connectionString) in
D:\DATEN\AmonD\Views\AmonD_FAZProject\FrameworkLight\MsEnterpriseLibrary\Data\Inhouse\DbConnectionScope.cs:line
310
at Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateConnection()
in
D:\DATEN\AmonD\Views\AmonD_FAZProject\FrameworkLight\MsEnterpriseLibrary\Data\Database.cs:line
135
at Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection()
in
D:\DATEN\AmonD\Views\AmonD_FAZProject\FrameworkLight\MsEnterpriseLibrary\Data\Database.cs:line
1255
at
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand
command) in
D:\DATEN\AmonD\Views\AmonD_FAZProject\FrameworkLight\MsEnterpriseLibrary\Data\Database.cs:line
732
at
InhouseWKOIT.Faz.DataAccess.Import.Images.ImageWriterFacade.saveImage(ImportImage
image)
---

I'm using the MS Enterprise Library and call my business logic as shwon
bellow:
---
TransactionOptions transactionOption = new TransactionOptions();
transactionOption.Timeout = TimeSpan.FromMinutes(180);
transactionOption.IsolationLevel = IsolationLevel.ReadCommited;

using (TransactionScope transactionScope = new
TransactionScope(TransactionScopeOption.Required, transactionOption))
{
performAction();
transactionScope.Complete();
}
--
(Where performAction actually does some BusinessLogic).

So why the timeout raises after about 30min, even if it's set to 3 hours?

thanks for help,
dominik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top