Councurrent Deletes (on multiple threads) of the same object cause Xtensive.Orm.SyntaxErrorException in rare cases (race condition?). This should be reported as missing object or something, but not as syntax error.

Xtensive.Orm.SyntaxErrorException: SQL error occured. SQL error details 'Type: SyntaxError;' Query 'DELETE FROM [dbo].[#Tmp_c79160ad-d67b-49ce-bb67-f50fbe7e9689];' Original message 'Ungültiger Objektname '#Tmp_c79160ad-d67b-49ce-bb67-f50fbe7e9689'.' ---> System.Data.SqlClient.SqlException: Ungültiger Objektname '#Tmp_c79160ad-d67b-49ce-bb67-f50fbe7e9689'. bei System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) bei System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) bei System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) bei System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout) bei System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) bei System.Data.SqlClient.SqlCommand.ExecuteNonQuery() bei Xtensive.Orm.Providers.StorageDriver.<executenonquery>bc(DbCommand c) bei Xtensive.Orm.Providers.StorageDriver.ExecuteCommandTResult bei Xtensive.Orm.Providers.StorageDriver.ExecuteNonQuery(Session session, DbCommand command) bei Xtensive.Orm.Providers.Command.ExecuteNonQuery() bei Xtensive.Orm.Providers.BatchingCommandProcessor.ExecuteBatch(Int32 numberOfTasks, QueryRequest lastRequest) bei Xtensive.Orm.Providers.BatchingCommandProcessor.ExecuteTasks(Boolean allowPartialExecution) bei Xtensive.Orm.Providers.CommandProcessor.ExecuteTasks() bei Xtensive.Orm.Providers.SqlSessionHandler.Xtensive.Orm.Providers.IProviderExecutor.Clear(IPersistDescriptor descriptor) bei Xtensive.Orm.Providers.SqlTemporaryDataProvider.ClearAndUnlock(EnumerationContext context) bei Xtensive.Orm.Providers.SqlIncludeProvider.OnAfterEnumerate(EnumerationContext context) bei Xtensive.Orm.Rse.Providers.ExecutableProvider.OnAfterEnumerate(EnumerationContext context) bei Xtensive.Orm.Rse.Providers.ExecutableProvider.OnAfterEnumerate(EnumerationContext context) bei Xtensive.Orm.Rse.Providers.ExecutableProvider.<getenumerator>d0.<>mFinally5() bei Xtensive.Orm.Rse.Providers.ExecutableProvider.<getenumerator>d0.System.IDisposable.Dispose() bei Xtensive.Orm.Rse.Providers.ExecutableProvider.<getenumerator>d0.MoveNext() bei Xtensive.Core.EnumerableExtensions.<batch>d201.MoveNext() bei Xtensive.Core.EnumerableExtensions.<ApplyBeforeAndAfter>d__281.MoveNext() bei Xtensive.Orm.Rse.RecordSet.<getbatchedenumerator>dc.MoveNext() bei System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() bei Xtensive.Core.EnumerableExtensions.<Batch>d__201.MoveNext() bei Xtensive.Core.EnumerableExtensions.<applybeforeandafter>d281.MoveNext() bei System.Linq.Enumerable.<SelectManyIterator>d__142.MoveNext() bei WSRScheduler.Model.Engine.OpenDnsListUrl.ProcessTask(Session session, TaskResultBase taskbase) bei WSRServices.Scheduler.TaskProcessor.<>cDisplayClass1a.<processtasks>b17(Int32 retryCount, Boolean exclusive) bei WSRServices.Threading.ReprocessExclusiveHandler.Invoke(Action`2 action) in D:\Work\WSR\WSRServiceBaseLib\WSRDataServiceBaseLib\Threading\ReprocessExclusiveHandler.cs:Zeile 137. bei WSRServices.Scheduler.TaskProcessor.ProcessTasks(Int32 threadIndex)

asked Oct 15 '12 at 11:34

Thomas%20Maierhofer's gravatar image

Thomas Maierhofer
738812


One Answer:

Hello Thomas,

I think the message is correct because it says about non-existent database object. From server standpoint it's an error in the SQL query.

However, this situation should not happen with proper usage of DataObjects.Net. So it's likely that you've found a bug in DO.

answered Oct 15 '12 at 12:32

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov
179325

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

powered by OSQA