}
}
try {
BeanStateSynchronization pmcontract = (BeanStateSynchronization)inv.ejb;
pmcontract.ejb__flush();
} catch( Throwable ex ) {
//check the type of the method and create the corresponding exception
if( invInfo.startsWithCreate ) {
CreateException ejbEx = new CreateException();
ejbEx.initCause(ex);