1 Reply Latest reply on Nov 30, 2002 11:38 AM by Scott Walters

    Question about EjbPostCreate.

    Alvaro Newbie

      Hi

      The WebLogic 7.0 app server´s dbms configuration descriptor has a tag
      <delay-database-insert-until> which defines the stage in an entity bean´s
      create process in which the bean is persisted in the database.
      The allowed values are: ejbPostCreate(default), ejbCreate and commit
      This is useful when we need to create a child entity from inside the
      ejbPostCreate method of a parent entity. The fereign-key field on the
      child´s table will try to match an existing key on the parent, but since it
      has not been persisted, a violation error will occur. To avoid that, and
      still use the foreign-key constraint in the child´s table, we use the
      "ejbCreate" or "commit" value on the tag in the parent bean´s descriptor.

      Is there a similar feature in JBoss ? Or is there another way around this
      problem ?


      Alvaro


        • 1. Re: Question about EjbPostCreate.
          Scott Walters Newbie

          I don't understand why you're having the problem. By the time ejbPostCreate is called for the parent entity, it's database row should already be persisted. If your child table's fk fields are defined as non-nullable cmr fields, your error may actually be caused by jboss attempting to insert a null value for these columns.