4 Replies Latest reply on Jan 10, 2005 5:27 AM by hirowla

    Possible problem with batch-cascade-delete in 4.0.1

    hirowla

      I have created a CMP entity bean with 3 CMR relationships, one of which has a cascade delete. When I attempt to delete the bean, I get a failure because the field is set to null (which is not permitted because of a database constraint).

      So I added the batch-cascade-delete parameter to the jbosscmp-jdbc.xml. However I get an error deleting the bean on a DIFFERENT relationship - which does not have the cascade delete attribute.

      Apart from debating the need for the batch-cascade-delete attribute (surely it should be the default action), why does adding this attribute affect a field to which it is not applied? And how can I fix it?

      I have 2 logs below - one where I had the batch-cascade-delete attribute on the bean, and one where the attribute is not there (and fails because it sets a non-null field to null). I also have the relevent sections of the ejb-jar.xml and jbosscmp-jdbc.xml file.

      Any help solving this would be appreciated.

      Thanks,

      Ian

      This is the log wih the batch-cascade-delete attribute:

      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.LoginAccount] RESET PERSISTENCE CONTEXT: id=[.1724.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.LoginAccount] Default eager-load for entity: readahead=null
      2005-01-08 14:04:26,687 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.LoginAccount] Executing SQL: SELECT account_profile_id, account_state_id, created, last_login, last_modified, last_modified_user, login_name, num_login_failures, password, password_expiration, security_user_id FROM LOGIN_ACCOUNT WHERE (login_id=?)
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#loginId] param: i=1, type=INTEGER, value=1724
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#accountProfileId] result: i=1, type=java.lang.Integer, value=1
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#accountStateId] result: i=2, type=java.lang.Integer, value=1
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#created] result: i=3, type=java.sql.Timestamp, value=2005-01-08 14:03:56.59
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#lastLogin] result: i=4, type=java.sql.Timestamp, value=null
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#lastModified] result: i=5, type=java.sql.Timestamp, value=2005-01-08 14:03:56.59
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#lastModifiedUser] result: i=6, type=java.lang.Integer, value=1
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#loginName] result: i=7, type=java.lang.String, value=loginZZ
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#numLoginFailures] result: i=8, type=java.lang.Integer, value=null
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#password] result: i=9, type=java.lang.String, value=password
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#passwordExpiration] result: i=10, type=java.sql.Timestamp, value=null
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#userId] result: i=11, type=java.lang.Integer, value=1
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.LoginAccount.activeLogins] Read ahead cahce load: cmrField=activeLogins pk=[.1724.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,687 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.LoginAccount] load relation SQL: SELECT session_id FROM ACTIVE_LOGIN WHERE (login_id=?)
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.ActiveLogin#loginId] param: i=1, type=INTEGER, value=1724
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.ActiveLogin#sessionId] result: i=1, type=java.lang.Integer, value=1515
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.ActiveLogin] Add preload data: entity=ActiveLogin pk=[.1515.] field=login
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.ActiveLogin] RESET PERSISTENCE CONTEXT: id=[.1515.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.ActiveLogin] load data: entity=ActiveLogin pk=[.1515.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.ActiveLogin] Preloading data: entity=ActiveLogin pk=[.1515.] cmrField=login
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.ActiveLogin] Scheduled for batch-cascade-delete: [.1515.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.LoginAccount.accountProfile] Read ahead cahce load: cmrField=accountProfile pk=[.1724.]
      2005-01-08 14:04:26,687 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AccountProfile] RESET PERSISTENCE CONTEXT: id=[.1.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountProfile] load data: entity=AccountProfile pk=[.1.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountProfile] No preload data found: entity=AccountProfile pk=[.1.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.AccountProfile] Default eager-load for entity: readahead=null
      2005-01-08 14:04:26,702 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AccountProfile] Executing SQL: SELECT created, description, last_modified, last_modified_user, max_concurrent_sessions, max_login_failures, password_expiration_period FROM ACCOUNT_PROFILE WHERE (account_profile_id=?)
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#accountProfileId] param: i=1, type=INTEGER, value=1
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#created] result: i=1, type=java.sql.Timestamp, value=2005-01-08 14:03:45.903
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#description] result: i=2, type=java.lang.String, value=Profile 1
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#lastModified] result: i=3, type=java.sql.Timestamp, value=2005-01-08 14:03:45.903
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#lastModifiedUser] result: i=4, type=java.lang.Integer, value=1
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#maxConcurrentSessions] result: i=5, type=java.lang.Integer, value=null
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#maxLoginFailures] result: i=6, type=java.lang.Integer, value=null
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#passwordExpirationPeriod] result: i=7, type=java.lang.Integer, value=null
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.AccountProfile] Remove relation: field=LoginAccount_accountProfile id=[.1.] relatedId=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.LoginAccount.accountState] Read ahead cahce load: cmrField=accountState pk=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AccountState] RESET PERSISTENCE CONTEXT: id=[.1.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountState] load data: entity=AccountState pk=[.1.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountState] No preload data found: entity=AccountState pk=[.1.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.AccountState] Default eager-load for entity: readahead=null
      2005-01-08 14:04:26,702 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AccountState] Executing SQL: SELECT created, description, last_modified, last_modified_user FROM ACCOUNT_STATE WHERE (account_state_id=?)
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#accountStateId] param: i=1, type=INTEGER, value=1
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#created] result: i=1, type=java.sql.Timestamp, value=2005-01-08 14:03:45.92
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#description] result: i=2, type=java.lang.String, value=Disabled
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#lastModified] result: i=3, type=java.sql.Timestamp, value=2005-01-08 14:03:45.92
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#lastModifiedUser] result: i=4, type=java.lang.Integer, value=1
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.AccountState] Remove relation: field=LoginAccount_accountState id=[.1.] relatedId=[.1724.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.CascadeDeleteStrategy$BatchCascadeDeleteStrategy.LoginAccount] Removing [.1515.]
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.LoginAccount] Remove relation: field=activeLogins id=[.1724.] relatedId=[.1515.]
      2005-01-08 14:04:26,702 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.LoginAccount] Executing SQL: UPDATE LOGIN_ACCOUNT SET account_profile_id=?, account_state_id=? WHERE login_id=?
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#accountProfileId] param: i=1, type=INTEGER, value=NULL
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#accountStateId] param: i=2, type=INTEGER, value=NULL
      2005-01-08 14:04:26,702 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#loginId] param: i=3, type=INTEGER, value=1724
      2005-01-08 14:04:26,702 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.ejb.EJBLocalObject.remove() throws javax.ejb.RemoveException,javax.ejb.EJBException, causedBy:
      java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'account_profile_id', table 'Dev.dbo.LOGIN_ACCOUNT'; column does not allow nulls. UPDATE fails.
       at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
       at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
       at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
       at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:316)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:136)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreMana
      ger.java:651)
       at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)
       at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)
       at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)
       at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)
       at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:166)
       at org.jboss.ejb.EntityContainer.synchronizeEntitiesWithinTransaction(EntityContainer.java:122)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:97)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:682)
       at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:506)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:454)
       at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:530)
       at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1159)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:72)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:273)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:111)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:242)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
       at org.jboss.ejb.Container.invoke(Container.java:870)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
       at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
       at $Proxy138.remove(Unknown Source)
       at org.jboss.ejb.plugins.cmp.jdbc.CascadeDeleteStrategy.invokeRemoveRelated(CascadeDeleteStrategy.java:321)
       at org.jboss.ejb.plugins.cmp.jdbc.CascadeDeleteStrategy$BatchCascadeDeleteStrategy.cascadeDelete(CascadeDeleteStrategy.java:174)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.cascadeDelete(JDBCCMRFieldBridge.java:406)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.cascadeDelete(JDBCEntityBridge.java:322)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:117)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:682)
       at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:506)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:454)
       at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:530)
       at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1159)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:72)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:273)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:111)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:242)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
       at org.jboss.ejb.Container.invoke(Container.java:870)
       at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
       at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
       at sun.rmi.transport.Transport$1.run(Transport.java:148)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:534)
      2005-01-08 14:04:26,718 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException in method: public abstract void javax.ejb.EJBObject.remove() throws java.rmi.RemoteException,javax.ejb.RemoveException, causedBy:
      java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'account_profile_id', table 'Dev.dbo.LOGIN_ACCOUNT'; column does not allow nulls. UPDATE fails.
       at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
       at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
       at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
       at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:316)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:136)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651)
       at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)
       at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)
       at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)
       at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)
       at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:166)
       at org.jboss.ejb.EntityContainer.synchronizeEntitiesWithinTransaction(EntityContainer.java:122)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:97)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:682)
       at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:506)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:454)
       at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:530)
       at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1159)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:72)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:273)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:111)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:242)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
       at org.jboss.ejb.Container.invoke(Container.java:870)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
       at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
       at $Proxy138.remove(Unknown Source)
       at org.jboss.ejb.plugins.cmp.jdbc.CascadeDeleteStrategy.invokeRemoveRelated(CascadeDeleteStrategy.java:321)
       at org.jboss.ejb.plugins.cmp.jdbc.CascadeDeleteStrategy$BatchCascadeDeleteStrategy.cascadeDelete(CascadeDeleteStrategy.java:174)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.cascadeDelete(JDBCCMRFieldBridge.java:406)
       at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.cascadeDelete(JDBCEntityBridge.java:322)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:117)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:682)
       at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:506)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:454)
       at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:530)
       at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1159)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:72)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:273)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:111)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:242)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
       at org.jboss.ejb.Container.invoke(Container.java:870)
       at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
       at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
       at sun.rmi.transport.Transport$1.run(Transport.java:148)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:534)
      


      This is the log when the batch-cascade-delete is not there
      2005-01-08 13:59:05,218 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.LoginAccount] RESET PERSISTENCE CONTEXT: id=[.1706.]
      2005-01-08 13:59:05,218 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,218 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,218 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.LoginAccount] Default eager-load for entity: readahead=null
      2005-01-08 13:59:05,218 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.LoginAccount] Executing SQL: SELECT account_profile_id, account_state_id, created, last_login, last_modified, last_modified_user, login_name, num_login_failures, password, password_expiration, security_user_id FROM LOGIN_ACCOUNT WHERE (login_id=?)
      2005-01-08 13:59:05,218 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#loginId] param: i=1, type=INTEGER, value=1706
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#accountProfileId] result: i=1, type=java.lang.Integer, value=1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#accountStateId] result: i=2, type=java.lang.Integer, value=1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#created] result: i=3, type=java.sql.Timestamp, value=2005-01-08 13:58:16.337
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#lastLogin] result: i=4, type=java.sql.Timestamp, value=null
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#lastModified] result: i=5, type=java.sql.Timestamp, value=2005-01-08 13:58:16.337
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#lastModifiedUser] result: i=6, type=java.lang.Integer, value=1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#loginName] result: i=7, type=java.lang.String, value=loginZZ
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#numLoginFailures] result: i=8, type=java.lang.Integer, value=null
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#password] result: i=9, type=java.lang.String, value=password
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#passwordExpiration] result: i=10, type=java.sql.Timestamp, value=null
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.LoginAccount#userId] result: i=11, type=java.lang.Integer, value=1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.LoginAccount.accountProfile] Read ahead cahce load: cmrField=accountProfile pk=[.1706.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AccountProfile] RESET PERSISTENCE CONTEXT: id=[.1.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountProfile] load data: entity=AccountProfile pk=[.1.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountProfile] No preload data found: entity=AccountProfile pk=[.1.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.AccountProfile] Default eager-load for entity: readahead=null
      2005-01-08 13:59:05,234 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AccountProfile] Executing SQL: SELECT created, description, last_modified, last_modified_user, max_concurrent_sessions, max_login_failures, password_expiration_period FROM ACCOUNT_PROFILE WHERE (account_profile_id=?)
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#accountProfileId] param: i=1, type=INTEGER, value=1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#created] result: i=1, type=java.sql.Timestamp, value=2005-01-08 13:57:57.967
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#description] result: i=2, type=java.lang.String, value=Profile 1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#lastModified] result: i=3, type=java.sql.Timestamp, value=2005-01-08 13:57:57.967
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#lastModifiedUser] result: i=4, type=java.lang.Integer, value=1
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#maxConcurrentSessions] result: i=5, type=java.lang.Integer, value=null
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#maxLoginFailures] result: i=6, type=java.lang.Integer, value=null
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountProfile#passwordExpirationPeriod] result: i=7, type=java.lang.Integer, value=null
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.AccountProfile] Remove relation: field=LoginAccount_accountProfile id=[.1.] relatedId=[.1706.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.LoginAccount.activeLogins] Read ahead cahce load: cmrField=activeLogins pk=[.1706.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,234 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.LoginAccount] load relation SQL: SELECT session_id FROM ACTIVE_LOGIN WHERE (login_id=?)
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.ActiveLogin#loginId] param: i=1, type=INTEGER, value=1706
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.ActiveLogin#sessionId] result: i=1, type=java.lang.Integer, value=1500
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.ActiveLogin] Add preload data: entity=ActiveLogin pk=[.1500.] field=login
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.ActiveLogin] RESET PERSISTENCE CONTEXT: id=[.1500.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.ActiveLogin] load data: entity=ActiveLogin pk=[.1500.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.ActiveLogin] Preloading data: entity=ActiveLogin pk=[.1500.] cmrField=login
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.ActiveLogin] Scheduled for cascade-delete: [.1500.]
      2005-01-08 13:59:05,234 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.ActiveLogin] Remove relation: field=login id=[.1500.] relatedId=[.1706.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.LoginAccount.accountState] Read ahead cahce load: cmrField=accountState pk=[.1706.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] load data: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.LoginAccount] No preload data found: entity=LoginAccount pk=[.1706.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AccountState] RESET PERSISTENCE CONTEXT: id=[.1.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountState] load data: entity=AccountState pk=[.1.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.ReadAheadCache.AccountState] No preload data found: entity=AccountState pk=[.1.]
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.AccountState] Default eager-load for entity: readahead=null
      2005-01-08 13:59:05,250 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.AccountState] Executing SQL: SELECT created, description, last_modified, last_modified_user FROM ACCOUNT_STATE WHERE (account_state_id=?)
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#accountStateId] param: i=1, type=INTEGER, value=1
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#created] result: i=1, type=java.sql.Timestamp, value=2005-01-08 13:57:57.983
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#description] result: i=2, type=java.lang.String, value=Disabled
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#lastModified] result: i=3, type=java.sql.Timestamp, value=2005-01-08 13:57:57.983
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.AccountState#lastModifiedUser] result: i=4, type=java.lang.Integer, value=1
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.AccountState] Remove relation: field=LoginAccount_accountState id=[.1.] relatedId=[.1706.]
      2005-01-08 13:59:05,250 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.ActiveLogin] Executing SQL: UPDATE ACTIVE_LOGIN SET login_id=? WHERE session_id=?
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.ActiveLogin#loginId] param: i=1, type=INTEGER, value=NULL
      2005-01-08 13:59:05,250 TRACE [org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.ActiveLogin#sessionId] param: i=2, type=INTEGER, value=1500
      2005-01-08 13:59:05,250 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException in method: public abstract void javax.ejb.EJBObject.remove() throws java.rmi.RemoteException,javax.ejb.RemoveException, causedBy:
      java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Cannot insert the value NULL into column 'login_id', table 'Dev.dbo.ACTIVE_LOGIN'; column does not allow nulls. UPDATE fails.
       at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
       at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
       at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
       at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
       at com.microsoft.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
       at com.microsoft.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:316)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.execute(JDBCStoreEntityCommand.java:136)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.storeEntity(JDBCStoreManager.java:651)
       at org.jboss.ejb.plugins.CMPPersistenceManager.storeEntity(CMPPersistenceManager.java:413)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:390)
       at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:743)
       at org.jboss.ejb.GlobalTxEntityMap$2.synchronize(GlobalTxEntityMap.java:134)
       at org.jboss.ejb.GlobalTxEntityMap$GlobalTxSynchronization.synchronize(GlobalTxEntityMap.java:253)
       at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:166)
       at org.jboss.ejb.EntityContainer.synchronizeEntitiesWithinTransaction(EntityContainer.java:122)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:97)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.removeEntity(JDBCStoreManager.java:682)
       at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:506)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.removeEntity(CachedConnectionInterceptor.java:454)
       at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:530)
       at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1159)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:72)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:273)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:111)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:242)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:514)
       at org.jboss.ejb.Container.invoke(Container.java:870)
       at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
       at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
       at sun.rmi.transport.Transport$1.run(Transport.java:148)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:534)
      


      Here is the ejb-jar.xml

      <ejb-relation >
       <ejb-relation-name>LoginAccount-ActiveLogin</ejb-relation-name>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>ActiveLogins belong to one LoginAccount</ejb-relationship-role-name>
       <multiplicity>Many</multiplicity>
       <cascade-delete/>
       <relationship-role-source >
       <ejb-name>ActiveLogin</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>login</cmr-field-name>
       </cmr-field>
       </ejb-relationship-role>
      
       <ejb-relationship-role >
       <ejb-relationship-role-name>LoginAccount has many ActiveLogins</ejb-relationship-role-name>
       <multiplicity>One</multiplicity>
       <relationship-role-source >
       <ejb-name>LoginAccount</ejb-name>
       </relationship-role-source>
       <cmr-field >
       <cmr-field-name>activeLogins</cmr-field-name>
       <cmr-field-type>java.util.Set</cmr-field-type>
       </cmr-field>
       </ejb-relationship-role>
      
       </ejb-relation>
      


      Here is the jbosscmp-jdbc.xml file (with the batch-cascade-delete parameter):
      <ejb-relation>
       <ejb-relation-name>LoginAccount-ActiveLogin</ejb-relation-name>
      
       <ejb-relationship-role>
       <ejb-relationship-role-name>ActiveLogins belong to one LoginAccount</ejb-relationship-role-name>
       <key-fields/>
       <batch-cascade-delete/>
      
       </ejb-relationship-role>
       <ejb-relationship-role>
       <ejb-relationship-role-name>LoginAccount has many ActiveLogins</ejb-relationship-role-name>
       <key-fields>
       <key-field>
       <field-name>loginId</field-name>
       <column-name>login_id</column-name>
       </key-field>
       </key-fields>
      
       </ejb-relationship-role>
       </ejb-relation>