4 Replies Latest reply on Aug 28, 2002 4:27 PM by Dain Sundstrom

    CMR and EJBStore

    David Baillieul Newbie

      A page table has been defined with a foreign key to a process table. When adding a page to a process, the server returns null for the process id in the page, which causes a NPE when trying to create the page proxy.
      The sequence of events is as follows:
      1) The pageBean is created (ejbCreate is called), resulting in an insert in the database. The process id for the page is not set at that time, because it is a CMR field.
      2) ejbPostCreate is called. The process id is set.
      3) the invoker gets a proxy object for the page. This result in a call to get the processId for the page that in turn does a select on the page row. This returns a null.
      What seems to be missing is the call to update the process id in the page row. This normally occurs as part of ejbStore.
      ejbStore is not invoked in this case because the transaction is not committed, or if a finder is invoked.
      A possible workaround would be to invoke a finder to retrieve the page, but that is not a clean approach. Any similiar experiences/solutions????