1 Reply Latest reply on Jun 27, 2002 12:18 AM by kammi

    Transaction Isolation problem

    kammi Newbie

      Hi,all, I've write a piece of code like this:
      UserInfo u=home.create(id,getLoginName(),getPassword(),getUserName());
      PaymentHome phome= (PaymentHome)HomeManager.getHome("Payment");
      phome.create(new Integer(pid),u.getId(),getPay());

      and In database, Table PAYMENT has a constraint named FK_PAYMENT01 says that,
      user_id in table payment is a foreign key and it refer to USER_INFO's
      primary key "ID".

      when I invoke this method, it report and exception :
      javax.ejb.CreateException:
      Could not create entity:java.sql.SQLException: ORA-02291:
      integrity constraint (FK_PAYMENT01) violated - parent key not found

      I think it's because the two entity beans create method are in different
      isolation level, so , one can not read another's uncommit information.
      I've set all these session beans and entity beans trasacation property to
      Require, but it still can not work.

      any one can give me some hints?

      Best regard.

      Erik Lee.