0 Replies Latest reply on Oct 28, 2004 4:51 PM by Ivan O. Parra

    jdbc2 on 3_2_6 support for entity-command attribute

    Ivan O. Parra Novice

      We have an ejb using the new jdbc2 container with:

      <entity-command name="pk-sql">
       <attribute name="pk-sql">SELECT OUR_SEQ.nextval FROM DUAL</attribute>
       </entity-command>


      the ejbCreate stage is essentially a noop.(return null; to be exact).

      We keep getting:


      13:14:26,906 ERROR [AppConfigSessionBean] com.ourcompany.persistance.ABean@152b008
      javax.ejb.CreateException: Primary key for created instance is null.
       at org.jboss.ejb.plugins.cmp.jdbc2.JDBCStoreManager2.createEntity(JDBCStoreManager2.java:289)
       at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:211)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:270)
       at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:577)
       at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1070)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
       at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:204)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:128)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:85)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:478)
       at org.jboss.ejb.Container.invoke(Container.java:729)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:347)
       at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
       at $Proxy581.create(Unknown Source)


      I grepped through the code base for entity-command and only found references in the jdbc(not jdbc2) package. Any one able to make this work? Is this just a missing feature?