1 Reply Latest reply on Jul 21, 2006 5:23 AM by Stefan Craatz

    [EJB 3.0] EntityBean (table) shared between EntityManger and

    toto last Newbie

      Hello , I'am a beginner in EJB 3.

      JBOSS 4 + EJB 3.

      1\ I persist and object in database (Oracle) using entitymanager. (primary key generate AUTO)

      2\ I add manually an object in database unsing JDBC (increment last primary key genrate by 1)

      3\ I try to persist and other object in database using entitymanger but i obtain a primary key violation.

      How synchronize entityManager' ID with database after adding an object manually ? (I have try Flush() but it don't work)

      What is the best way to generate primary key if i use Oracle ?