Joined: Mon May 11, 2009 7:28 am Posts: 8
|
Hi Everyone, i have encountered the following problem in my project while i am using Nhibernate (version 1.2.0.4000): I have a windows service (local service) that when it is started, it calls a web service in my solution that triggers a transaction to be executed. The transaction contains a very long procedure of validations, saving, inserting, and many other processes in it which takes expectedly 15-20 minutes to finish. But after the transaction begins and works normally for about 8-9 minutes, the transaction stops and the following crash is registered in my log: 2009-05-07 17:23:14,637 [14] ERROR | NHibernate.Util.ADOExceptionReporter - cannot open connection 2009-05-07 17:23:14,637 [14] WARN | NHibernate.Util.ADOExceptionReporter - 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 NHibernate.Connection.DriverConnectionProvider.GetConnection() at NHibernate.Impl.SessionFactoryImpl.OpenConnection() 2009-05-07 17:23:14,637 [14] ERROR | NHibernate.Util.ADOExceptionReporter - The operation is not valid for the state of the transaction. 2009-05-07 17:23:14,637 [14] WARN | NHibernate.Util.ADOExceptionReporter - System.TimeoutException: Transaction Timeout 2009-05-07 17:23:14,637 [14] ERROR | NHibernate.Util.ADOExceptionReporter - Transaction Timeout 2009-05-07 17:23:14,668 [14] ERROR | KFSC.Hrm.Services - Exception caught at: OnScheduledEvent() 2009-05-07 17:23:14,918 [14] ERROR | My Logger - Unhandled exception NHibernate.ADOException: cannot open connection ---> 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 NHibernate.Connection.DriverConnectionProvider.GetConnection() at NHibernate.Impl.SessionFactoryImpl.OpenConnection() --- End of inner exception stack trace --- at NHibernate.Impl.SessionFactoryImpl.OpenConnection() at NHibernate.Impl.ConnectionManager.GetConnection() at NHibernate.Impl.BatcherImpl.Prepare(IDbCommand cmd) at NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd) at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session) at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes) at NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor session) at NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria, IList results) at NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) at NHibernate.Impl.CriteriaImpl.List() at NHibernate.Impl.CriteriaImpl.UniqueResult() at NHibernate.Impl.CriteriaImpl.UniqueResult[T]() at KFSC.Hrm.Services.AnnualRaiseService.UpdateEmployeeDegree(EmployeeInfo e, DateTime date, IEmployeeRepository empRep) in D:\Projects\KFSC\3.Developing\Sourcecode\KFSC.Hrm\KFSC.HRM.Services\AnnualRaise\AnnualRaiseService.cs:line 237 at KFSC.Hrm.Services.AnnualRaiseService.<>c__DisplayClass9.<ApplyAnnualRaiseToEmployee>b__8() in D:\Projects\KFSC\3.Developing\Sourcecode\KFSC.Hrm\KFSC.HRM.Services\AnnualRaise\AnnualRaiseService.cs:line 221 at EsFramework.With.Transaction(IsolationLevel level, Proc transactional) in D:\Projects\KFSC\3.Developing\Sourcecode\EsFramework\With\With.Transaction.cs:line 45 at EsFramework.With.Transaction(Proc transactional) in D:\Projects\KFSC\3.Developing\Sourcecode\EsFramework\With\With.Transaction.cs:line 68 at KFSC.Hrm.Services.AnnualRaiseService.ApplyAnnualRaiseToEmployee(Nullable`1 raiseId, EmployeeInfo e, DateTime date, Nullable`1 decisionId, Int32 applicantId, Int32 transactionType, IEmployeeRepository empRep, Boolean isBatch, Boolean skipValidation, Guid batchKey, Boolean raiseError) in D:\Projects\KFSC\3.Developing\Sourcecode\KFSC.Hrm\KFSC.HRM.Services\AnnualRaise\AnnualRaiseService.cs:line 218 at KFSC.Hrm.Services.AnnualRaiseService.SaveAnnualRaiseForEmployees(Nullable`1 raiseId, ICollection`1 employees, DateTime date, Nullable`1 decisionId, Int32 applicantId, Int32 transactionType, Boolean isBatch, Guid batchKey, Boolean raiseErrors) in D:\Projects\KFSC\3.Developing\Sourcecode\KFSC.Hrm\KFSC.HRM.Services\AnnualRaise\AnnualRaiseService.cs:line 183 at KFSC.Hrm.Services.AnnualRaiseService.OnScheduledEvent(DateTime date, KeyValueXML keyValueXml) in D:\Projects\KFSC\3.Developing\Sourcecode\KFSC.Hrm\KFSC.HRM.Services\AnnualRaise\AnnualRaiseService.cs:line 328I have made some steps to solve it -but it failed totally-, as followed:1- I tried to increase the transaction timeout for the NHibernate connection in my config:Code: <property name="connection.connection_string"> Data Source=Es-sys403; Initial Catalog=GRP;User ID=sa; password=sa2005; Connect Timeout=3600 </property> and it still not working and the same error occurs !!!2- I tried to change transaction timeout property in the Component Services -> COM+ Applications from 60 seconds to 3600 seconds and still the same !!!!Can anyone please help Thanks
|
|