the EntityManager obtained by injection, i.e. is it container-managed
with JTA transaction type?
you verify that the container transaction was rolled back?
What container are you using?
I think I've found a bug in eclipselink, but
before I file it, I want to be sure it's really a bug:
3) the transaction
is rolled back (because an exception is thrown)
4) The data from (1) is
stored in the database (as seen from the mysql command line)
understand flush, it should not commit the data. From http://download.oracle.com/docs/cd/B32110_01/web.1013/b28221/usclient005.htm#CIHCIBGB
Example 29-29 shows, you can use EntityManager method flush to send updates to
the database within a transaction before the transaction is
Here's the test code to reproduce the
class MetaStorage implements IMetaStorage, IMetaStorageRemote
Document document = new Document();
// flush to force ID
class StorageException extends RuntimeException