public static boolean beginOrJoinTransaction ( ) { boolean newTransaction = false ; try { newTransaction = userTransaction . getStatus ( ) == Status . STATUS_NO_TRANSACTION ; if ( newTransaction ) { userTransaction . begin ( ) ; } } catch ( Exception e ) { throw new RuntimeException ( "Unable to start transaction." , e ) ; } return newTransaction ; }
Start or join a transaction .