The primary key is annotated with @GeneratedValue(strategy=GenerationType.IDENTITY)
and we found in earlier work that after the entity was persisted in the DB, the primary key
in the entity object that we had a reference to was not updated. We found that adding the
flush() call after the persist() forced the entity object's primary key to be set from the
now-persisted and auto-generated primary key in the DB.
[Message sent by forum member 'skalynuk' (skalynuk)]
http://forums.java.net/jive/thread.jspa?messageID=244137