// else inserted the same pk first, the insert would fail
if ( !veto ) {
generatedId = persister.insert( state, instance, session );
if ( persister.hasInsertGeneratedProperties() ) {
persister.processInsertGeneratedProperties( generatedId, instance, state, session );
}
//need to do that here rather than in the save event listener to let
//the post insert events to have a id-filled entity when IDENTITY is used (EJB3)
persister.setIdentifier( instance, generatedId, session );
getSession().getPersistenceContext().registerInsertedKey( getPersister(), generatedId );