We get the following error on some of our transactions: Transaction aborted. Inner exception: System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session.

We could not figure it out, so we ran it using a different service, same database, same client code. It does not error. Any thoughts on why this is only occurring when we use the one service, which is our QC service, which we use all the time to test.

asked Nov 08 '10 at 16:31

dku's gravatar image

dku
6333


2 Answers:

That's always a good idea to capture a stack trace.

As far as I can judge, this error indicates:

  • There is an open data reader bound to some connection
  • AND you're trying to open a transaction in it (in another or the same thread).

So you should check if this is possible.

answered Nov 08 '10 at 17:15

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Here is the stack trace:

Type:          System.Data.SqlClient.SqlException                  
Message:       New transaction is not allowed because there are other threads running in the session.                                                             
Stack Trace:     
 Server stack trace: at DataObjects.NET.DataObject.InnerReload(Boolean manual)     
    at DataObjects.NET.DataObject.Reload(Boolean manual)
    at DataObjects.NET.DataObject.get_State()
    at DataObjects.NET.DataObject.GetProperty(String name, Culture culture, Boolean getInternalValue)
    at AGO.UserInfoImpl_DataObjectsDotNetProxy.GetProperty(String _name, Culture _culture, Boolean _getInternalValue) in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 28886
    at DataObjects.NET.DataObject.GetProperty(String name, Culture culture)
    at AGO.UserInfoImpl_DataObjectsDotNetProxy.get__EnabledAccess() in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 27924     
    at AGO.UserInfoImpl.get_EnabledAccess()     
    at AGO.UserInfoImpl_DataObjectsDotNetProxy.get_EnabledAccess() in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 28079     
    at AGO.UserInfoImpl.IsAccessEnabled(UserAccessTypes AccessType)     
    at AGO.UserInfoImpl_DataObjectsDotNetProxy.IsAccessEnabled(UserAccessTypes _AccessType) in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 28594     
    at AGO.UserInfoImpl.get_Enabled()     
    at AGO.UserInfoImpl_DataObjectsDotNetProxy.get_Enabled() in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 27977     
    at AGO.Internal.AGEmployeeInfoImpl.get_ManagerName()     
    at AGO.Internal.AGEmployeeInfoValues..ctor(AGEmployeeInfo obj)     
    at AGO.Consumer.ComplaintImpl.get_AssignedToValue()     
    at AGO.Consumer.ComplaintImpl_DataObjectsDotNetProxy.get_AssignedToValue() in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 187544     
    at AGO.Consumer.ComplaintValues.get_AssignedToValue()     
    at AGO.Consumer.ComplaintImpl.set_ComplaintValueObject(ComplaintValues value)     
    at AGO.Consumer.ComplaintImpl_DataObjectsDotNetProxy.set_ComplaintValueObject(ComplaintValues value) in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 188137     
    at AGO.Consumer.ComplaintValues.Save()     
    at AGO.Consumer.ConsumerObjectServiceImpl.CreateOrSaveComplaint(ComplaintValues complaint, PersonValues collector, Phone collectorPhone)     
    at AGO.Consumer.ConsumerObjectServiceImpl_DataObjectsDotNetProxy.CreateOrSaveComplaint(ComplaintValues _complaint, PersonValues _collector, Phone _collectorPhone) in c:\Services\EnterpriseDataService Console\ProxyAssembly.cs:line 191689     
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     
    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     
    at AGO.Consumer.ConsumerObjectService.CreateOrSaveComplaint(ComplaintValues complaint, PersonValues collector, Phone collectorPhone)     
    at OSCAR_Win.ComplaintDetailsForm.UpdateComplaintObjectValue(Complaint& complaint)

answered Nov 09 '10 at 15:18

dku's gravatar image

dku
6333

edited Nov 10 '10 at 07:25

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

So likely, my assumption about the cause was correct. Try to check if the same Session is used concurrently.

(Nov 10 '10 at 07:28) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×22

Asked: Nov 08 '10 at 16:31

Seen: 5,637 times

Last updated: Nov 10 '10 at 07:28

powered by OSQA