-
1. Re: Container artifacts should have symmetric lifecycles
emuckenhuber Oct 3, 2008 9:43 AM (in response to emuckenhuber)I've commited some test cases and the tests are passing for Session and MessageDriven beans.
There are two tests still failing regarding to CMP (which are disabled in the normal test runs atm)
org.jboss.test.ejb.lifecycle.test.CmpLifeCycleUnitTest
org.jboss.test.ejb.lifecycle.test.UserTransactionLifeCycleUnitTest
Those tests are failing with this exception:Error checking if entity exists:java.sql.SQLException: S1000 General error java.lang.RuntimeException: prepared statement is no longer valid javax.ejb.CreateException: Error checking if entity exists:java.sql.SQLException: S1000 General error java.lang.RuntimeException: prepared statement is no longer valid at org.jboss.ejb.plugins.cmp.jdbc.JDBCInsertPKCreateCommand.beforeInsert(JDBCInsertPKCreateCommand.java:105) at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:150) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:587) at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:237) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:223) at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:783) at org.jboss.invocation.Invocation.performCall(Invocation.java:386) at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1130) at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:106) at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:203) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:187) at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:106) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:137) at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76) at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:45) at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161) at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:224) at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:199) at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:100) at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invokeHome(PreSecurityInterceptor.java:88) at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107) at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:525) at org.jboss.ejb.Container.invoke(Container.java:1045) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.invocation.unified.server.UnifiedInvoker.invoke(UnifiedInvoker.java:232) at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908) at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742) at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695) at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:549) at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230) at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:206) at org.jboss.remoting.Client.invoke(Client.java:1708) at org.jboss.remoting.Client.invoke(Client.java:612) at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:162) at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:244) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:181) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:87) at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:184) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)
As mentioned before - moving the code which starts/stops the associated persistenceManager
to the EjbModule makes those tests pass. I've attached a patch showing those changes to the related JIRA issue. -
2. Re: Container artifacts should have symmetric lifecycles
aloubyansky Oct 6, 2008 7:57 AM (in response to emuckenhuber)It's complicated with CMP (and maybe EJB in general) since there could be CMR (or other non declared EJB references).
CMRs aren't translated into service dependencies. So, just restarting an entity bean is not safe. And IMO it shouldn't be a requirement to be able to restart a single container in an EJB module. Instead, the whole EJB module should be restarted since this is what a deployment unit is. Stopping one of the services should stop the whole module.