bleroy / vandelay

Fine Latex Products - A module for Orchard CMS that does lots of stuff
13 stars 12 forks source link

Custom Sort Duplicate Key Error #38

Open bleroy opened 8 years ago

bleroy commented 8 years ago

I've already some custom sort order, but just now since 1.9.1 I've run into this error trying to create a new CSO.

[SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PKVandelay3214EC07865DCCDB'. Cannot insert duplicate key in object 'dbo.Vandelay_Industries_CustomSortOrderRecord'. The duplicate key value is (105).
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction) +1787814 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action 1 wrapCloseInAction) +5341674
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +546
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1693
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +275
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +1421
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource 1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +177 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource 1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +208
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +163
System.Data.SqlClient.SqlCommand.ExecuteBatchRPCCommand() +38
System.Data.SqlClient.SqlCommandSet.ExecuteNonQuery() +286
NHibernate.AdoNet.SqlClientSqlCommandSet.ExecuteNonQuery() +39
NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps) +222

[GenericADOException: could not execute batch command.[SQL: SQL not available]]
NHibernate.AdoNet.SqlClientBatchingBatcher.DoExecuteBatch(IDbCommand ps) +273
NHibernate.AdoNet.AbstractBatcher.ExecuteBatchWithTiming(IDbCommand ps) +122
NHibernate.AdoNet.AbstractBatcher.ExecuteBatch() +62
NHibernate.Engine.ActionQueue.ExecuteActions(IList list) +90
NHibernate.Engine.ActionQueue.ExecuteActions() +16
NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session) +182
NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) +92
NHibernate.Impl.SessionImpl.Flush() +346
NHibernate.Transaction.AdoTransaction.Commit() +298
Orchard.Data.SessionLocator.DisposeSession() in c:\Web\Orchard\Orchard\src\Orchard\Data\SessionLocator.cs:75
Orchard.Data.SessionLocator.Dispose() in c:\Web\Orchard\Orchard\src\Orchard\Data\SessionLocator.cs:66
Autofac.Core.Disposer.Dispose(Boolean disposing) +81
Autofac.Util.Disposable.Dispose() +36
Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing) +65
Autofac.Util.Disposable.Dispose() +36
Orchard.Environment.<>cDisplayClass7.<.ctor>b4() in c:\Web\Orchard\Orchard\src\Orchard\Environment\WorkContextAccessor.cs:94
Orchard.Environment.HttpContextScopeImplementation.System.IDisposable.Dispose() in c:\Web\Orchard\Orchard\src\Orchard\Environment\WorkContextAccessor.cs:99
Orchard.Mvc.Routes.<ProcessRequestAsync>d__7.MoveNext() in c:\Web\Orchard\Orchard\src\Orchard\Mvc\Routes\ShellRoute.cs:181
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52
System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) +60
System.Web.HttpTaskAsyncHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +6
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9651796
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Work Item Details

Original CodePlex Issue: Issue 42 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 8, 2015 at 12:56 AM Reported by: nxtjv Updated on: Oct 7, 2015 at 7:31 PM Updated by: dpomt Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 8, 2015 at 12:56 AM Reported by: nxtjv Updated on: Oct 7, 2015 at 7:31 PM Updated by: dpomt

bleroy commented 8 years ago

On 2015-10-08 02:31:22 UTC, @dpomt commented:

did not see this issue and re-entered it. See https://vandelay.codeplex.com/workitem/44 for the solution.