This question is locked. New answers and comments are not allowed.
Hi all
I'm using Telerik Data Access and using it to generate our plain WCF service. I actually really like how it generates the service.
However, everything goes wrong when an exception occurs. This could be a very simple exception, like an object not being found by it's DTO key or trying to add an object with the same value for a unique field as an existing one. When this happens, every CRUD operation that I'm trying to execute (on the client sent to the WCF service and so to the data access library and the database) gives me a LockNotGrantedException. This exception (the LockNotGrantedException) keeps being thrown for every operation (even valid ones), until I restart the WCF service (which is not supposed to happen).
Stack trace (sorry for the little bit of Dutch in there...):
Next, I also noticed that the client application (a console application in this case) kept trying to execute the operation, even after the LockNotGrantedException was thrown in the service application. So I had to stop the client application to stop the calls to the WCF service. I don't know if that is something caused by the service and the LockNotGrantedException, or something specific to a console application?
I can also give you the following information. I tried to change the isolation level of the model and setting it to ReadUncommited still caused a LockNotGrantedException to be thrown when any operation occurs that throws an exception and still caused the console application to keep trying to execute the operation, but when shutting down the console application and restarting it, valid operations don't throw this LockNotGrantedException anymore.
As a side note: because in the docs it is stated that it is deprecated to change the isolation level on the model, I configured it like this:
What other information can I give you? Well, of course I extended the interface (I made it partial in the T4 templates) and the service. I also extended the assemblers to transform SqlGeography in WKT and so I also extended the DTO's to add this WKT to the relevant objects.
I also adapted the T4 templates for the assemblers a bit. I implemented the AssembleNavigational() and adapted it in a way that no StackOverflowException occurs. This way it is possible to get a DTO with its navigation properties. I also changed the T4 templates so a method was added that made the reverse also possible: filling navigation properties on the DTO's and so setting those in the entities. That way, it is also possible to execute CUD operations with the navigation properties on the DTO on the client. Of course, I did set 'IsManaged' to 'true'.
Can someone help me with this LockNotGrantedException?
Please ask when further information is required. However, this is quite important and urgent. ;)
Kind regards
Thomas
I'm using Telerik Data Access and using it to generate our plain WCF service. I actually really like how it generates the service.
However, everything goes wrong when an exception occurs. This could be a very simple exception, like an object not being found by it's DTO key or trying to add an object with the same value for a unique field as an existing one. When this happens, every CRUD operation that I'm trying to execute (on the client sent to the WCF service and so to the data access library and the database) gives me a LockNotGrantedException. This exception (the LockNotGrantedException) keeps being thrown for every operation (even valid ones), until I restart the WCF service (which is not supposed to happen).
Stack trace (sorry for the little bit of Dutch in there...):
Telerik.OpenAccess.Exceptions.LockNotGrantedException
Telerik.OpenAccess.RT.sql.SQLException: Lock request time out period exceeded. ---> System.Data.SqlClient.SqlException: Lock request time out period exceeded.
bij System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
bij System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
bij System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
bij System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
bij System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
bij System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
bij System.Data.SqlClient.SqlDataReader.Read()
bij OpenAccessRuntime.Intellitrace.Read(DbDataReader reader, String id)
bij Telerik.OpenAccess.Runtime.Logging.LoggingDbDataReader.Read()
bij Telerik.OpenAccess.RT.Adonet2Generic.Impl.ResultSetImp.next()
--- Einde van intern uitzonderingsstackpad ---
bij Telerik.OpenAccess.RT.Adonet2Generic.Impl.ResultSetImp.next()
bij OpenAccessRuntime.Relational.fetch.FetchResultImp.rsNext()
bij OpenAccessRuntime.Relational.fetch.FetchResultImp.hasNext()
Next, I also noticed that the client application (a console application in this case) kept trying to execute the operation, even after the LockNotGrantedException was thrown in the service application. So I had to stop the client application to stop the calls to the WCF service. I don't know if that is something caused by the service and the LockNotGrantedException, or something specific to a console application?
I can also give you the following information. I tried to change the isolation level of the model and setting it to ReadUncommited still caused a LockNotGrantedException to be thrown when any operation occurs that throws an exception and still caused the console application to keep trying to execute the operation, but when shutting down the console application and restarting it, valid operations don't throw this LockNotGrantedException anymore.
As a side note: because in the docs it is stated that it is deprecated to change the isolation level on the model, I configured it like this:
protected
override
void
Init(
string
connectionString,
string
cacheKey, BackendConfiguration backendConfiguration, MetadataContainer metadataContainer, Assembly callingAssembly)
{
base
.Init(connectionString, cacheKey, backendConfiguration, metadataContainer, callingAssembly);
this
.ContextOptions.IsolationLevel = IsolationLevel.ReadUncommitted;
}
What other information can I give you? Well, of course I extended the interface (I made it partial in the T4 templates) and the service. I also extended the assemblers to transform SqlGeography in WKT and so I also extended the DTO's to add this WKT to the relevant objects.
I also adapted the T4 templates for the assemblers a bit. I implemented the AssembleNavigational() and adapted it in a way that no StackOverflowException occurs. This way it is possible to get a DTO with its navigation properties. I also changed the T4 templates so a method was added that made the reverse also possible: filling navigation properties on the DTO's and so setting those in the entities. That way, it is also possible to execute CUD operations with the navigation properties on the DTO on the client. Of course, I did set 'IsManaged' to 'true'.
Can someone help me with this LockNotGrantedException?
Please ask when further information is required. However, this is quite important and urgent. ;)
Kind regards
Thomas