// else inserted the same pk first, the insert would fail
if ( !veto ) {
generatedId = persister.insert( getState(), instance, session );
if ( persister.hasInsertGeneratedProperties() ) {
persister.processInsertGeneratedProperties( generatedId, instance, getState(), 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 );
session.getPersistenceContext().registerInsertedKey( getPersister(), generatedId );