Page 1 of 1
System.Transactions: timed out transactions crash host process
Posted: Wed 12 Dec 2012 15:58
by UltimaDeveloper
Hi. I am using Devart dotConnect provider for Oracle in Direct mode (version 6.80) in conjunction with System.Transactions classes. When network connection to Oracle is lost or Oracle session is killed (from an external application), I sometimes get the unhandled exception which crashes my process.
Apparently System.Transactions is doing something behind the scenes like rolling back timed out transactions every now and then. But dotConnect throws an exception when Rollback is called and the connection is in invalid state (i.e, session is killed or tcp connection to Oracle server is closed):
Message: ORA-03113: end-of-file on communication channel
at Devart.Data.Oracle.c2.a(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.Oracle.c2.a(Byte& A_0)
at Devart.Data.Oracle.cw.b(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.Oracle.cw.f()
at Devart.Data.Oracle.cp.c()
at Devart.Data.Oracle.as.c()
at Devart.Data.Oracle.OracleInternalConnection.Rollback()
at Devart.Common.r.b(Enlistment A_0)
at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment)
at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx)
at System.Transactions.EnlistableStates.Timeout(InternalTransaction tx)
at System.Transactions.Bucket.TimeoutTransactions()
at System.Transactions.BucketSet.TimeoutTransactions()
at System.Transactions.TransactionTable.ThreadTimer(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
We have no control over System.Transactions behavior, so we can't handle exceptions dotConnect is throwing on a worker thread taken from the thread pool. How do we prevent the application from crashing in such a condition?
Re: System.Transactions: timed out transactions crash host process
Posted: Thu 13 Dec 2012 15:40
by wscalf
Not sure if this is relevant, but are you disposing your TransactionScope (ie: 'usinging' it?) That should, based on my understanding of it, be when it rolls back the transaction, and you would probably want to do that before closing your connection, disposing your DbContext, etc.
Re: System.Transactions: timed out transactions crash host process
Posted: Fri 14 Dec 2012 12:48
by UltimaDeveloper
Thanks wscalf for your suggestion, I think it might be relevant and I've already tried to investigate it. I've found that all TransactionScope instances are disposed of properly (via «using» statements).
Re: System.Transactions: timed out transactions crash host process
Posted: Mon 17 Dec 2012 16:11
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.
Re: System.Transactions: timed out transactions crash host process
Posted: Mon 17 Dec 2012 21:37
by UltimaDeveloper
Thanks a lot Pinturiccio!
I'm looking forward to hearing from you.
Re: System.Transactions: timed out transactions crash host process
Posted: Tue 19 Feb 2013 16:36
by UltimaDeveloper
Hi Pinturiccio!
Any news on this one?
Re: System.Transactions: timed out transactions crash host process
Posted: Fri 22 Feb 2013 14:44
by Pinturiccio
We are investigating the issue, but we can't tell any timeframe at the moment.
Re: System.Transactions: timed out transactions crash host process
Posted: Mon 11 Mar 2013 12:55
by UltimaDeveloper
Hi Pinturiccio!
Pinturiccio wrote:we can't tell any timeframe at the moment.
Why not?
Did you assign the job of resolving this issue to a developer?
Can you tell me at least rough approximation when to expect the bugfix?
Weeks? Months?
Re: System.Transactions: timed out transactions crash host process
Posted: Tue 12 Mar 2013 13:28
by Pinturiccio
Our development team is investigating the issue. We haven't found the solution yet and we don't know when the issue will be solved.
Re: System.Transactions: timed out transactions crash host process
Posted: Fri 15 Mar 2013 09:45
by UltimaDeveloper
Thanks for your reply.
Can you suggest a workaround?
What can we do to save our server process from crashing while your team is investigating the issue?
Also, we just encountered a bit different situation.
Temporary connection problems caused the process crash with a different stack trace:
in Devart.Data.Oracle.DirectUtils.b(Int32 A_0)
in Devart.Data.Oracle.as.c()
in Devart.Data.Oracle.OracleInternalConnection.Rollback()
in Devart.Common.r.c(SinglePhaseEnlistment A_0)
in System.Transactions.DurableEnlistmentAborting.EnterState(InternalEnlistment enlistment)
in System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx)
in System.Transactions.EnlistableStates.Timeout(InternalTransaction tx)
in System.Transactions.Bucket.TimeoutTransactions()
in System.Transactions.BucketSet.TimeoutTransactions()
in System.Transactions.TransactionTable.ThreadTimer(Object state)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.TimerQueueTimer.CallCallback()
in System.Threading.TimerQueueTimer.Fire()
in System.Threading.TimerQueue.FireNextTimers()
P.S. This server is running with Devart.Data.Oracle.dll version 6.3.0.185
Re: System.Transactions: timed out transactions crash host process
Posted: Fri 15 Mar 2013 20:18
by UltimaDeveloper
And here is another one (Devart.Data.Oracle.dll version 6.80.350.0):
Devart.Data.Oracle.OracleException, Message: "ORA-01012: not logged on"
in Devart.Data.Oracle.at.d()
in Devart.Data.Oracle.cp.c()
in Devart.Data.Oracle.as.c()
in Devart.Data.Oracle.OracleInternalConnection.Rollback()
in Devart.Common.r.c(SinglePhaseEnlistment A_0)
in System.Transactions.DurableEnlistmentAborting.EnterState(InternalEnlistment enlistment)
in System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx)
in System.Transactions.EnlistableStates.Timeout(InternalTransaction tx)
in System.Transactions.Bucket.TimeoutTransactions()
in System.Transactions.BucketSet.TimeoutTransactions()
in System.Transactions.TransactionTable.ThreadTimer(Object state)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
in System.Threading.TimerQueueTimer.CallCallback()
in System.Threading.TimerQueueTimer.Fire()
in System.Threading.TimerQueue.FireNextTimers()
Looks like any exception thrown on a worker thread during System.Transactions.BucketSet.TimeoutTransactions... is unhandled and leads to the termination of the host process.
Re: System.Transactions: timed out transactions crash host process
Posted: Tue 19 Mar 2013 14:35
by Pinturiccio
We've made some corrections concerning this issue in our new build. When the new build is released, please check whether the issue is solved. We will post here when the corresponding build of dotConnect for Oracle is available for download.
Re: System.Transactions: timed out transactions crash host process
Posted: Wed 20 Mar 2013 14:18
by UltimaDeveloper
Thanks a lot Pinturiccio!
Looking forward to your posting.
Re: System.Transactions: timed out transactions crash host process
Posted: Wed 30 Oct 2013 16:14
by slaxman
We are running into the same issue with version 7.2.122.0. Is there a fix?
Re: System.Transactions: timed out transactions crash host process
Posted: Wed 06 Nov 2013 10:01
by Pinturiccio
We can't reproduce the issue with an uncatchable exception from the background thread, that causes the application termination. We have fixed the issue in dotConnect for Oracle 7.7.257. Try using the latest version of dotConnect for Oracle. You can download dotConnect for Oracle Trial from our site
http://www.devart.com/dotconnect/oracle/download.html and test your application.