2 Replies Latest reply on Mar 16, 2006 4:44 AM by Roberto Colmegna

    Delayed insert

    Roberto Colmegna Newbie

      Hi,

      I have a small test-code (on JBOSS 4.0.4RC1) which execute this actions:

      1) create an ABean (persistenced on DB)
      2) create an BBean (whith an idA() prop) (persistenced on DB)
      3) create an CBean (whith an idA() and idB() props) (persistenced on DB)
      4) I excute an ABean.getBBeans() on the bean created in step (1)
      [this select, via CBean, all BBeans indirectly linked to ABean]

      In step 4 I obtain a "null" set. Analizing log I have noted that the
      ABean.getBBeans() EJB3-generated query is executed BEFORE
      the three INSERT! :(

      How is this possibile? Can JBoss delay an insert AFTER a query which
      retrieve the inserted beans?

      TIA
      Roberto Colmegna