{"action":"created","issue":{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/26","labels_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/26/comments","events_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/26/events","html_url":"https://github.com/bleroy/OrchardImportTest/issues/26","id":65600577,"number":26,"title":"Roles - Delete when existing users attached.","user":{"login":"bleroy","id":1165609,"avatar_url":"https://avatars.githubusercontent.com/u/1165609?v=3","gravatar_id":"","url":"https://api.github.com/users/bleroy","html_url":"https://github.com/bleroy","followers_url":"https://api.github.com/users/bleroy/followers","following_url":"https://api.github.com/users/bleroy/following{/other_user}","gists_url":"https://api.github.com/users/bleroy/gists{/gist_id}","starred_url":"https://api.github.com/users/bleroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleroy/subscriptions","organizations_url":"https://api.github.com/users/bleroy/orgs","repos_url":"https://api.github.com/users/bleroy/repos","events_url":"https://api.github.com/users/bleroy/events{/privacy}","received_events_url":"https://api.github.com/users/bleroy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-01T04:08:39Z","updated_at":"2015-04-01T04:08:46Z","closed_at":null,"body":"1 Create a role.  \n2 Add a couple of users to that role.  \n3 Delete role.  \n  \nLooks like you have missed a cascade delete on the DB or at application level.  \n  \n  \n  \nServer Error in '/' Application.  \nThe DELETE statement conflicted with the REFERENCE constraint\n\"FK43A22D322A3119A4\". The conflict occurred in database \"Orchard\", table\n\"dbo.UserRolesRecord\", column 'Role_id'.  \nThe statement has been terminated.  \nDescription: An unhandled exception occurred during the execution of the\ncurrent web request. Please review the stack trace for more information about\nthe error and where it originated in the code.  \n  \nException Details: System.Data.SqlClient.SqlException: The DELETE statement\nconflicted with the REFERENCE constraint \"FK43A22D322A3119A4\". The conflict\noccurred in database \"Orchard\", table \"dbo.UserRolesRecord\", column 'Role_id'.  \nThe statement has been terminated.  \n  \nSource Error:  \n  \nLine 31: if (!_cancelled)  \nLine 32: _scope.Complete();  \nLine 33: _scope.Dispose();  \nLine 34: }  \nLine 35: }  \n  \n  \nSource File: D:\\InformationServices\\Prototypes\\CMS\\orchard-44851\\trunk\\src\\Orc\nhard\\Data\\TransactionManager.cs Line: 33  \n  \nStack Trace:  \n  \n[SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE\nconstraint \"FK43A22D322A3119A4\". The conflict occurred in database \"Orchard\",\ntable \"dbo.UserRolesRecord\", column 'Role_id'.  \nThe statement has been terminated.]  \nSystem.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean\nbreakConnection) +1951450  \nSystem.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,\nBoolean breakConnection) +4849003  \nSystem.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject\nstateObj) +194  \nSystem.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand\ncmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler,\nTdsParserStateObject stateObj) +2394  \nSystem.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,\nRunBehavior runBehavior, String resetOptionsString) +204  \nSystem.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior\ncmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)\n+954  \nSystem.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,\nRunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult\nresult) +162  \nSystem.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result,\nString methodName, Boolean sendToPipe) +175  \nSystem.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137  \nNHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd) +303  \nNHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation) +64  \nNHibernate.Persister.Entity.AbstractEntityPersister.Delete(Object id, Object\nversion, Int32 j, Object obj, SqlCommandInfo sql, ISessionImplementor session,\nObject[] loadedState) +1656  \n  \n[GenericADOException: could not delete:\n[Orchard.Roles.Records.RoleRecord#1][SQL: DELETE FROM [RoleRecord] WHERE Id =\n?]]  \nNHibernate.Persister.Entity.AbstractEntityPersister.Delete(Object id, Object\nversion, Int32 j, Object obj, SqlCommandInfo sql, ISessionImplementor session,\nObject[] loadedState) +2145  \nNHibernate.Persister.Entity.AbstractEntityPersister.Delete(Object id, Object\nversion, Object obj, ISessionImplementor session) +430  \nNHibernate.Action.EntityDeleteAction.Execute() +624  \nNHibernate.Engine.ActionQueue.Execute(IExecutable executable) +187  \nNHibernate.Engine.ActionQueue.ExecuteActions(IList list) +125  \nNHibernate.Engine.ActionQueue.ExecuteActions() +110  \nNHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEven\ntSource session) +221  \nNHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)\n+101  \nNHibernate.Impl.SessionImpl.Flush() +297  \nNHibernate.Transaction.DistributedTransactionContext.System.Transactions.IEnli\nstmentNotification.Prepare(PreparingEnlistment preparingEnlistment) +444  \n  \n[TransactionAbortedException: The transaction has aborted.]  \nSystem.Transactions.TransactionStateAborted.EndCommit(InternalTransaction tx)\n+11  \nSystem.Transactions.CommittableTransaction.Commit() +225  \nSystem.Transactions.TransactionScope.InternalDispose() +328  \nSystem.Transactions.TransactionScope.Dispose() +1607  \nOrchard.Data.TransactionManager.System.IDisposable.Dispose() in D:\\Information\nServices\\Prototypes\\CMS\\orchard-44851\\trunk\\src\\Orchard\\Data\\TransactionManage\nr.cs:33  \nAutofac.Disposer.Dispose(Boolean disposing) in\nd:\\Projects\\svn\\autofac-1.4\\src\\Source\\Autofac\\Disposer.cs:57  \nAutofac.Disposable.Dispose() in\nd:\\Projects\\svn\\autofac-1.4\\src\\Source\\Autofac\\Disposable.cs:23  \nAutofac.Container.Dispose(Boolean disposing) in\nd:\\Projects\\svn\\autofac-1.4\\src\\Source\\Autofac\\Container.cs:478  \nAutofac.Disposable.Dispose() in\nd:\\Projects\\svn\\autofac-1.4\\src\\Source\\Autofac\\Disposable.cs:23  \nAutofac.Integration.Web.ContainerProvider.DisposeRequestContainer() in d:\\Proj\nects\\svn\\autofac-1.4\\src\\Source\\Autofac.Integration.Web\\ContainerProvider.cs:5\n9  \nOrchard.Environment.DefaultOrchardHost.EndRequest() in D:\\InformationServices\\\nPrototypes\\CMS\\orchard-44851\\trunk\\src\\Orchard\\Environment\\DefaultOrchardHost.\ncs:49  \nOrchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.EndReq\nuest() in D:\\InformationServices\\Prototypes\\CMS\\orchard-44851\\trunk\\src\\Orchar\nd\\Environment\\DefaultOrchardHost.cs:114  \nOrchard.Web.MvcApplication.Application_EndRequest() in D:\\InformationServices\\\nPrototypes\\CMS\\orchard-44851\\trunk\\src\\Orchard.Web\\Global.asax.cs:99  \n  \n[TargetInvocationException: Exception has been thrown by the target of an\ninvocation.]  \nSystem.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[]\narguments, SignatureStruct& sig, MethodAttributes methodAttributes,\nRuntimeTypeHandle typeOwner) +0  \nSystem.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments,\nSignature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)\n+71  \nSystem.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags\ninvokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean\nskipVisibilityChecks) +350  \nSystem.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags\ninvokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29  \nSystem.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e)\n+42  \nSystem.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Ex\necute() +68  \nSystem.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&\ncompletedSynchronously) +75  \n  \n  \nVersion Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET\nVersion:2.0.50727.4927  \n\nWork Item Details\n--------------------\n**Original CodePlex Issue:**\t[Issue 15707](http://orchard.codeplex.com/workitem/15707)\n**Status:**\tClosed\n**Reason Closed:**\tUnassigned\n**Assigned to:**\tUnassigned\n**Reported on:**\tJan 4, 2010 at 12:48 PM\n**Reported by:**\tJetski5822\n**Updated on:**\tJan 4, 2010 at 6:58 PM\n**Updated by:**\tBertrandLeRoy\n**Closed on:**\tJan 4, 2010 at 6:58 PM\n"},"comment":{"url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/comments/88343612","html_url":"https://github.com/bleroy/OrchardImportTest/issues/26#issuecomment-88343612","issue_url":"https://api.github.com/repos/bleroy/OrchardImportTest/issues/26","id":88343612,"user":{"login":"bleroy","id":1165609,"avatar_url":"https://avatars.githubusercontent.com/u/1165609?v=3","gravatar_id":"","url":"https://api.github.com/users/bleroy","html_url":"https://github.com/bleroy","followers_url":"https://api.github.com/users/bleroy/followers","following_url":"https://api.github.com/users/bleroy/following{/other_user}","gists_url":"https://api.github.com/users/bleroy/gists{/gist_id}","starred_url":"https://api.github.com/users/bleroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleroy/subscriptions","organizations_url":"https://api.github.com/users/bleroy/orgs","repos_url":"https://api.github.com/users/bleroy/repos","events_url":"https://api.github.com/users/bleroy/events{/privacy}","received_events_url":"https://api.github.com/users/bleroy/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T04:08:45Z","updated_at":"2015-04-01T04:08:45Z","body":"On *2010-01-04 20:59:54 UTC*, **Jetski5822** commented:\n\nPlease close.\n"}}