System.Transactions: timed out transactions crash host process

System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Wed 12 Dec 2012 15:58

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?
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby wscalf » Thu 13 Dec 2012 15:40

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.
wscalf
 
Posts: 7
Joined: Wed 12 Dec 2012 00:18

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Fri 14 Dec 2012 12:48

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).
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby Pinturiccio » Mon 17 Dec 2012 16:11

We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.
Pinturiccio
Devart Team
 
Posts: 1955
Joined: Wed 02 Nov 2011 09:44

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Mon 17 Dec 2012 21:37

Thanks a lot Pinturiccio!
I'm looking forward to hearing from you.
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Tue 19 Feb 2013 16:36

Hi Pinturiccio!

Any news on this one?
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby Pinturiccio » Fri 22 Feb 2013 14:44

We are investigating the issue, but we can't tell any timeframe at the moment.
Pinturiccio
Devart Team
 
Posts: 1955
Joined: Wed 02 Nov 2011 09:44

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Mon 11 Mar 2013 12:55

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?
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby Pinturiccio » Tue 12 Mar 2013 13:28

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.
Pinturiccio
Devart Team
 
Posts: 1955
Joined: Wed 02 Nov 2011 09:44

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Fri 15 Mar 2013 09:45

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
Last edited by UltimaDeveloper on Fri 15 Mar 2013 21:18, edited 1 time in total.
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Fri 15 Mar 2013 20:18

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.
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby Pinturiccio » Tue 19 Mar 2013 14:35

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.
Pinturiccio
Devart Team
 
Posts: 1955
Joined: Wed 02 Nov 2011 09:44

Re: System.Transactions: timed out transactions crash host process

Postby UltimaDeveloper » Wed 20 Mar 2013 14:18

Thanks a lot Pinturiccio!
Looking forward to your posting.
UltimaDeveloper
 
Posts: 8
Joined: Wed 12 Dec 2012 15:27

Re: System.Transactions: timed out transactions crash host process

Postby slaxman » Wed 30 Oct 2013 16:14

We are running into the same issue with version 7.2.122.0. Is there a fix?
slaxman
 
Posts: 47
Joined: Wed 16 Sep 2009 20:09
Location: United States

Re: System.Transactions: timed out transactions crash host process

Postby Pinturiccio » Wed 06 Nov 2013 10:01

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.
Pinturiccio
Devart Team
 
Posts: 1955
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle