This is a migrated thread and some comments may be shown as answers.

Scope Module: IIS7 Integrated mode issues?

10 Answers 224 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sharbel Lutfallah
Top achievements
Rank 1
Sharbel Lutfallah asked on 11 Jul 2009, 07:11 PM
We've been using the scope module that Telerik recommends using for web-apps to handle a single scope for 1 http request as well as the disposal of said scope at the end of the request. 

Everything works great on our development server (vs2008 dev-webserver).  However, when I put the app over on our staging server (Windows 2008 server, IIS7, Integrated Mode) we get a lot of ORM errors that never come to surface when running on our development machine...  the ORM errors seem to be much less frequent when running in Classic (non-integrated) mode, but they do still appear from time to time.

I have a support ticket running for this issue but I wanted to see if other users are experiencing any of the following errors:

  • SqlConnection does not support parallel transactions
  • InvalidOperationException: The connection is already closed.
  • No active transaction.

Again, it seems like the errors are much more likely to happen when running in Integrated mode.  Is anyone else experiencing these issues?

10 Answers, 1 is accepted

Sort by
0
Dimitar Kapitanov
Telerik team
answered on 13 Jul 2009, 05:02 PM
Hi Sharbel Lutfallah,
We continued the conversation in the support thread that was opened by you.

Best wishes,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Garry Clark
Top achievements
Rank 1
answered on 21 Aug 2009, 12:36 PM
Can you also continue it here as well as I am having the same issue? I implemented Gabe Sumner's hybrid Role/Membership provider solution that can be found here, http://www.sitefinitywatch.com/notes/09-07-20/Membership_and_Role_Providers.aspx, into my Sitefinity project using OpenAccess as the DAL. I am now getting this error when editing pages occasionally.

I am not running on IIS7 Intergrated Mode though I am running on an Windows 2003 IIS6 server with a SQL 2005 backend.

Any help in solving this would be greatly appreciated.


Server Error in '/' Application.  
--------------------------------------------------------------------------------  
 
SqlConnection does not support parallel transactions.   
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.   
 
Exception Details: System.InvalidOperationException: SqlConnection does not support parallel transactions.  
 
Source Error:   
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.    
 
Stack Trace:   
 
 
[InvalidOperationException: SqlConnection does not support parallel transactions.]  
   System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(IsolationLevel iso, String transactionName) +280  
   System.Data.SqlClient.SqlInternalConnection.BeginTransaction(IsolationLevel iso) +12  
   System.Data.SqlClient.SqlConnection.BeginDbTransaction(IsolationLevel isolationLevel) +63  
   System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction(IsolationLevel isolationLevel) +10  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.DefBeginTransaction() +25  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.Sql2005Factory.Telerik.OpenAccess.RT.Adonet2Generic.Impl.IADOFactory.BeginTransaction(ConnectionImp c) +9  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.BeginTxn() +23  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.get_CurrentTransaction() +31  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.Prepare() +43  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() +43  
 
[SQLException: Please check, that the genericADO2 driver is not used with SQL Server 2000 as it does not support MARS; please use instead in the backendconfiguration element: backend="mssql" driver="ntds"   
]  
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() +264  
   OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() +53  
   OpenAccessRuntime.Relational.fetch.FetchResultImp.execute() +62  
 
[DataStoreException: Error executing query: Telerik.OpenAccess.RT.sql.SQLException: Please check, that the genericADO2 driver is not used with SQL Server 2000 as it does not support MARS; please use instead in the backendconfiguration element: backend="mssql" driver="ntds"   
 ---> System.InvalidOperationException: SqlConnection does not support parallel transactions.  
   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(IsolationLevel isolationLevel)  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.DefBeginTransaction()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.Sql2005Factory.Telerik.OpenAccess.RT.Adonet2Generic.Impl.IADOFactory.BeginTransaction(ConnectionImp c)  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.BeginTxn()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.get_CurrentTransaction()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.Prepare()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()  
   --- End of inner exception stack trace ---  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()  
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()  
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.execute()  
SQL:  
SELECT a.[RoleID] AS COL1, b.[Name] AS xj1 FROM [SecurityMemberRoles] a LEFT JOIN [SecurityRoles] AS b ON (a.[RoleID] = b.[ID]) WHERE a.[Username] = ?         ORDER BY b.[Name]  Telerik.OpenAccess.RT.sql.SQLException: Please check, that the genericADO2 driver is not used with SQL Server 2000 as it does not support MARS; please use instead in the backendconfiguration element: backend="mssql" driver="ntds"   
 ---> System.InvalidOperationException: SqlConnection does not support parallel transactions.  
   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(IsolationLevel isolationLevel)  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.DefBeginTransaction()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.Sql2005Factory.Telerik.OpenAccess.RT.Adonet2Generic.Impl.IADOFactory.BeginTransaction(ConnectionImp c)  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.BeginTxn()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.get_CurrentTransaction()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.Prepare()  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()  
   --- End of inner exception stack trace ---  
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()  
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()  
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.execute()]  
   Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +4  
   Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +14  
   OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount) +223  
   OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getNextQueryResult(QueryResultWrapper aQrs, Int32 skipAmount) +44  
   OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam) +258  
   Telerik.OpenAccess.RT.ListEnumerator.setCurrent(Int32 _pos) +43  
   Telerik.OpenAccess.RT.ListEnumerator.Move(Int32 relative) +100  
   Telerik.OpenAccess.RT.ListEnumerator.MoveNext() +10  
   Telerik.OpenAccess.Query.TypedEnumerator`1.System.Collections.IEnumerator.MoveNext() +21  
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +7665172  
   Telerik.OpenAccess.Query.ObjectScopeQuery`2.ToList() +56  
   GambitCreations.Sitefinity.Security.RoleManager.GetRolesForUser(String username) +929  
   GambitCreations.Sitefinity.Security.RoleProvider.GetRolesForUser(String username) +201  
   System.Web.Security.RolePrincipal.GetRoles() +158  
   Telerik.Security.Permissions.ApplicationPermission.CheckDemand() +220  
   Telerik.Cms.Web.CmsHttpModule.PostAuthenticateAdminRequest(Boolean isAuthenticated, CmsHttpRequest request) +47  
   Telerik.Cms.Web.CmsHttpModule.context_PostAuthenticateRequest(Object sender, EventArgs e) +184  
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68  
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75  
 
   
 
 
--------------------------------------------------------------------------------  
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082  
0
Thomas
Telerik team
answered on 27 Aug 2009, 02:23 PM
Hi Garry Clark,

this indicates, that on the connection another activity was started and not finished properly. The offending code is _not_ the code you see on the stack, but something that for example started iterating a query result before and did not properly Dispose() the query result instance after being logically done with the result.
Please check your use of the query result instances, whether they are in a using or foreach statement.

I've put code in our runtime that will help to spot the real place where the Dispose() is likely to be missing; the next patch will have that change.

Regards,
Thomas
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sean
Top achievements
Rank 1
answered on 02 Dec 2009, 03:08 PM
Hi Thomas,

We are getting this problem on a site using the latest OA version.  Could you tell us what we are looking for to help us spot what is causing the "real" error?

Thanks
Sean
0
Sharbel Lutfallah
Top achievements
Rank 1
answered on 02 Dec 2009, 04:44 PM
Hi Sean,

My problem that I originally posted about really does appear to be my fault.  The datascope module that I created was did not appear to be disposing the scope properly.  Once I found the issue, and corrected it, I haven't had issues regarding this. 

0
Sean
Top achievements
Rank 1
answered on 02 Dec 2009, 11:25 PM
Thanks Sharbel,

We are pretty sure there is something in our code that is causing this too but it is like looking for the proverbial needle in a haystack.  Our issue only happens when the server is under load, so very hard to reproduce.  And we are using a Sitefinity Module to do this and as far as we can work out there is only an initialize event and no event that runs at the end of each request so when to dispose of the scope without having to create a brand new scope everytime we do a query.  We will no doubt have to raise a support request but I was wondering if there was an easy way of getting to where the problem is coming from.

Kind Regards
Sean.
0
Dimitar Kapitanov
Telerik team
answered on 04 Dec 2009, 07:05 AM
Hi Guys,
Please if you are able to acquire any patterns of behavior and statistics regarding this problem, do share them with us. Even if it is caused by your implementation (if not something very specific), we would like to know how you use our product, and whether something in your pattern of use is problematic for OpenAccess ORM.

Sincerely yours,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sean
Top achievements
Rank 1
answered on 04 Dec 2009, 09:04 AM
Hi Dimitar,

Well the good news is we fixed the issue we were having the bad news was that we don't know exactly which if the changes we implemented or all fixed the issue.

Basically we firstly changed when our scope was initiallized to Autobegin transactions instead of us implicitly starting them ourselves.
Secondly we reduced the amount of times we use Flush() on the transaction as apparently this leave a scope transaction tied to an SQL one, I read that somewhere in your documentation.
And lastly we changed a few of our queried in our sitefinity data provider to assign the List to a variable returning it:

eg

var query = from blah in CurrentScope.Extent<Category>() 
select blah; 
 
return blah.ToList() 
we changed to

var query = from blah in CurrentScope.Extent<Category>() 
select blah; 
 
var list = blah.ToList(); 
return list; 

And this then seemed to fix our problem.  As I said though before we were only getting errors when the site was under a heavy load.

Maybe you could look and see if any of those items I change you could use to replicate the problem?

Kind Regards
Sean


0
Dimitar Kapitanov
Telerik team
answered on 09 Dec 2009, 06:00 PM
Hi Sean,

 The pattern of the last thing you mentioned (the queries) is probably to resolve to differed disposing of the scope that is used by the query result. Also maybe the Flush reduction did it work... Well in all cases do keep us updated with any further problems you may experience, so that we pin-point the narrow place in our execution (if such is found). Thanks for the cooperation.


Kind regards,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Lafama
Top achievements
Rank 1
answered on 16 Aug 2010, 06:50 AM
hi,
I have been getting the same errors but then i realized that i had not updated the web config file with the required values
Please ensure that you put the following value 
under
 <appSettings> section
<add key="OpenAccessScopeKey" value="objectScope"/>
     <add key="OpenAccessTransactionKey" value="transactionScope"/>
     <add key="OpenAccessCommittableKey" value="committableKey"/>
     <add key="OpenAccessRollbackAll" value="true"/>

the sqlconnection and any other errors will disappear(worked for me)

Thanks
 
Tags
General Discussions
Asked by
Sharbel Lutfallah
Top achievements
Rank 1
Answers by
Dimitar Kapitanov
Telerik team
Garry Clark
Top achievements
Rank 1
Thomas
Telerik team
Sean
Top achievements
Rank 1
Sharbel Lutfallah
Top achievements
Rank 1
Lafama
Top achievements
Rank 1
Share this question
or