2 Replies Latest reply on Aug 21, 2003 11:52 AM by hassanz

    Jboss 3.2.1 Oracle Autoincrement

    pgrassi

      I have an EB with a 3-column compound primary key. One column in the key is auto-generated by a sequence (don't blame me, old design).

      The ejbCreate() method takes the 2 columns that are not auto-generated.

      The column that is auto-generate has a @jboss:persistence auto-increment = "true" XDoc tag.

      I get the following error:
      java.rmi.NoSuchObjectException: Entity not found: primaryKey=[.99.null.WV037KMR3C.]

      The '99' and 'WV0...' were passed in the ejbCreate(), the null is the auto-generated column.

      Any suggestions. I have found very little in regards to Oracle help. Is this the place for an <entity-command>

      Thanks,
      Paul

        • 1. Re: Jboss 3.2.1 Oracle Autoincrement
          pgrassi

          OK, I figured out the entity command, and it works if the primary key is a single column that is set as autoincrement, but as soon as I make the primary key compound, JBOSS pukes:

          12:55:36,426 DEBUG [Estimate] Executing SQL: select SEQ_RESTDT.NextVal + 1 FROM dual
          12:55:36,436 DEBUG [Estimate] Create: pk=33631
          12:55:36,436 DEBUG [Estimate] Executing SQL: SELECT COUNT(*) FROM RISER_ACTIVE.ESTIMATE_OV WHERE estimate_id=? AND work_
          order_id=?
          12:55:36,436 ERROR [Estimate] Error checking if entity exists
          javax.ejb.EJBException: Internal error getting primary key field member estimateId; CausedByException is:
          null
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.getPrimaryKeyValue(JDBCAbstractCMPFieldBridg

          • 2. Re: Jboss 3.2.1 Oracle Autoincrement
            hassanz

            I assume you are using a pl/sql procedure to generete auto increment keys in Oracle.

            I was having the same problem with the compound keys. and i dont know why it happens.

            I ended up generating my autokeys using the Block Sequence design pattern and it worked like a charm.

            Thanks,

            Hassan