OptimisticLockException causes transaction to rollback. So the exception that you get is TransactionRolledbackException. You can call em.flush() prior to utx.commit() to get the expected exception.
Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=343151