0 Replies Latest reply on Apr 19, 2004 5:06 AM by limatik

    multiple 1-* CMR TransactionRolledbackLocalException NoSuchO

    limatik

      Hi,

      I am using JBOSS 3.2.2, RH9 and Postgresql as db.

      I have multiple 1-* CMRs on a single EJB (on this case, AccountEJB has 1-* relationships with 5 different EJBs).

      In the accountsessionejb I have the following code:
      public Map getAllAccount() throws NotFoundException {

      Collection cAccount = null;
      Hashtable htAccount = new Hashtable();

      try {

      cAccount = accountHome.findAll();
      Iterator iterator = cAccount.iterator();

      while (iterator.hasNext()) {
      account = (LocalAccount) iterator.next();
      AccountVO accountVO = new AccountVO();

      accountVO.setControlNum(account.getControlnum()); <--- error!
      :
      :


      I can successfully add records to the db. But when I try to retrieve the existing records, the following happens:

      1. If there is only one (1) record, all is fine
      2. If there are more than one (1) records, the following exception occurs:

      004-04-15 17:34:02,584 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract com.slaps.model.valueobjects.AccountVO com.slaps.controller.ejb.entity.loan.account.LocalAccount.getAccountVO(), causedBy:
      javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=com.slaps.controller.ejb.entity.loan.account.AccountPK@910e0084


      I have tried to use version 3.2.3, but the same error occurs.

      I have not tried to use 3.2.1 although, that is out of the question, as we would like to use the newer versions.

      Hope you can help me out on this one ... :)

      Many thanks.