0 Replies Latest reply on Mar 10, 2008 6:06 PM by David Durst

    Other side of relationship not updating

    David Durst Newbie

      Hopefully I can convey my issue with out posting 1000 lines of code.

      I am using Jboss 4.0.4.GA.

      My programming situation is as followings

      Swing Application -> Stateful Session Bean -> Entity Manager -> DB

      I have a Object structure as follows:

      CommittedMap -- InvoiceQty -- InvoiceLine ---Invoice

      I have a Stateful session bean InvoiceFactoryBean.

      Which will create a Invoice and leave it open in a transaction for
      further modification.

      When adding a InvoiceLine which contains a InvoiceQty it does not appear
      to update the CommittedMap side of the relationship.

      To put it in simple terms if I do the following:

      public void addInvoiceLine(Interger qty, CommittedMap map) {
      InvoiceQty iqty = new InvoiceQty(qty,map);
      InvoiceLine line = new InvoiceLine();
      line.addInvoiceQty(iqty );
      invoice.addInvoiceLine(line);
      em.persist(invoice);
      }

      The invoice qty will not show on the committed map.

      I am sure it would if I committed the transaction I am in, but
      that defeats the purpose of what I am trying to do.

      Has anyone else had a similar experience?
      If so how did you work around this?