2 Replies Latest reply on Jan 19, 2006 9:53 PM by chrisbitmead

    The insert-after-ejb-post-create plus sequence problem - HEL

    chrisbitmead


      I have a CMR where the foreign key is NOT NULL. So I must turn on the insert-after-ejb-post-create option in standardjboss.xml. However I also have auto generated primary keys from oracle sequences. So now I get the error "Primary key for created instance is null", presumably because the ejb container can't cope with not getting a primary key as soon as ejbCreate completes.

      What is the solution?

        • 1. Re: The insert-after-ejb-post-create plus sequence problem -
          benbest

          Hi,

          If you found the solution I would be really interested to know it as I'm having exactly the same problem and I still don't know how to solve it except to temporarily disabling the foreign key constraints in oracle which is definitively NOT a solution !!

          • 2. Re: The insert-after-ejb-post-create plus sequence problem -
            chrisbitmead

            I havn't found a solution, I don't think there is any solution, I've tried about half a dozen approaches. It seems to me the EJB 2.0 spec is fundamentally broken in disallowing the setting of relationships, and jboss is broken in that the insert-after-ejb-post-create work around doesn't work. (I don't like the insert-after-ejb-post-create work around anyway, because it means the application can't work unless the jboss installation is modified. You can't just drop an ear into a jboss install and get it to work.)

            I wonder if EJB 3.0 is better?