Hi,
I have urgent problem on my production server. Application started throwing "SqlConnection does not support parallel transactions" errors. Users can't make any update to db. I must stress that application access database only through XPO (MS SQL Server 2008).
This is stack trace I see in event viewer:
User host address: yyy.yyy.yyy.yyy
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\zzz
Thread information:
Thread ID: 41
Thread account name: IIS APPPOOL\zzz
Is impersonating: False
Stack trace: at System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(IsolationLevel iso, String transactionName)
at System.Data.SqlClient.SqlInternalConnection.BeginTransaction(IsolationLevel iso)
at System.Data.SqlClient.SqlConnection.BeginDbTransaction(IsolationLevel isolationLevel)
at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction()
at DevExpress.Xpo.DB.ConnectionProviderSql.ConnectionBeginTransaction(Object il)
at DevExpress.Xpo.DB.ConnectionProviderSql.BeginTransactionCore(Object il)
at DevExpress.Xpo.DB.ConnectionProviderSql.BeginTransaction()
at DevExpress.Xpo.DB.MSSqlConnectionProvider.ProcessModifyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.DataStoreSerializedBase.ModifyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.ConnectionProviderSql.ModifyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.DataCacheRoot.ModifyDataCore(DataCacheCookie cookie, ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.Helpers.DataCacheBase.ModifyData(DataCacheCookie cookie, ModificationStatement[] statements)
at DevExpress.Xpo.DB.DataCacheNode.ModifyDataCore(DataCacheCookie cookie, ModificationStatement[] dmlStatements)
at DevExpress.Xpo.DB.Helpers.DataCacheBase.ModifyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.ThreadSafeDataLayer.ModifyData(ModificationStatement[] dmlStatements)
at DevExpress.Xpo.SimpleObjectLayer.CommitChanges(Session session, ICollection fullListForDelete, ICollection completeListForSave)
at DevExpress.Xpo.Session.FlushChangesInsideTransaction()
at DevExpress.Xpo.Session.FlushChanges()
at DevExpress.Xpo.Session.CommitTransaction()
at DevExpress.Xpo.UnitOfWork.CommitChanges()
at DIT.Persistence.Db.Xpo.XpoTransaction.Commit() in C:\workspace-vs2010\DITFramework\Main\Source\DIT.Persistence.Db.Xpo\XpoTransaction.cs:line 31
at DIT.Persistence.Support.PersistenceSupport.Commit() in C:\workspace-vs2010\DITFramework\Main\Source\DIT.Persistence\Support\PersistenceSupport.cs:line 149
at DIT.Security.Authentication.AppDatabase.AuthenticationHandler.FetchAppUser(IUserSession session, String username, Boolean passwordEncryptionActive) in C:\workspace-vs2010\DITFramework\Main\Source\DIT.Security\Authentication\AppDatabase\AuthenticationHandler.cs:line 49
at DIT.Security.Authentication.AppDatabase.AppDatabaseAuthenticationHandler.Authenticate(String username, String password, String& message, IUserSession session) in C:\workspace-vs2010\DITFramework\Main\Source\DIT.Security\Authentication\AppDatabase\AppDatabaseAuthenticationHandler.cs:line 11
at DIT.Security.Authentication.AuthenticationManager.Authenticate(String username, String password, String& message, HttpUserSession session) in C:\workspace-vs2010\DITFramework\Main\Source\DIT.Security\Authentication\AuthenticationManager.cs:line 48
at DIT2.Web.LoginPage.LoginButtonClick(HtmlInputText txtUserName, HtmlInputPassword txtUserPass, Label messageLabel) in c:\workspace-vs2010\DITFramework\Main\Source\DIT2\Web\LoginPage.cs:line 34
at ePlanNabave4_1.Login.Button2_Click(Object sender, EventArgs e) in C:\Documents and Settings\mtekic\My Documents\source_vs2010\ePlanNabave4_1\ePlanNabave4_1\Login.aspx.cs:line 15
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details:
Hi Slaven,
I'm afraid the information you provided is insufficient to diagnose this issue. If you are starting an explicit transaction, please make sure to finish it using either the ExplicitCommitTransaction or ExplicitRollbackTransaction method and do not use the current connection for anything else. If this does not help, please provide us with a small sample project, reproducing your issue. We'll research it, and do our best to find a solution.
Thanks,
Michael.
Michael,
I can't reproduce it because it started happening after application worked for a month. Also, problem disappeared after I restarted application. Maximum number of server connections property is set to unlimited.
I don't use explicit transactions.
I understand that you have problem reproducing this issue, but you also have knowledge of XPO internals. So I hoped that you could give me info what could be a reason for this. That info could help me to reproduce problem.
Thanks.
Hi Slaven,
I have discussed this issue with our developers, but unfortunately, we do not have an idea why this could happen. We have never been reported of a similar issue.
Thanks,
Michael.
Hi,
I don't know will this help, but I determined that this problem occurred when one of queries XPO generated reached timeout of 300 seconds.
Hi Slaven,
Could you please elaborate more on "one of queries XPO generated reached timeout of 300 seconds"? It seems that transaction is not committed because the thread that started it has been aborted.
Thanks,
Michael.
When "parallel transactions" error occurred I looked at sql profiler trace and found few transactions with duration of 300 seconds (those transactions were reason why I ran profiler in first place). One of devex forum posts said that XPO sets transaction timeout to 300 seconds, so I concluded that those transactions timed out. I solved problem with long running transactions, but I thought that those timeouts could be a reason for "parallel transactions" error. For instance, if XPO doesn't detect those situations properly it could assign same db transaction to different threads which could cause this error.
Hi Slaven,
Thank you for the update. We need additional time to research this issue. Would you please clarify how you have managed to solve the problem with long running transactions and whether this helps to eliminate the "parallel transactions" error?
Thanks,
Michael.
Hi,
sql query had problem with weird execution plan. I don't think that it had anything to do with this error except that execution plan caused timeout which could be a reason for error I reported. "parallel transactions" error was solved with app restart and haven't occurred since. But that doesn't mean it won't because (as I wrote previously) app worked for a month before error happened for first (and only) time.
Hi Slaven,
Thank you for the clarification. I will forward this issue to our developers so they can see if there is something in our code that could lead to this exception. We will inform you about the result.
Thanks,
Michael.
Hello Slaven,
Our developers have inspected all the information you provided, but have not managed to find out why the issue may occur. Since it was solved after restarting the application, probably it was not directly related to our components, but to some specific of SQL Server or IIS. For now, we will have to close the issue as not reproducible. Please feel free to contact us if it occurs again.
Thanks,
Anatol
OK. I will contact you if problem recur.