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 ?
I think EJB3 can use Oracle Sequences to generate primary keys.