private void success ( ) { org . hibernate . Transaction txn = session . getTransaction ( ) ; if ( txn != null && txn . getStatus ( ) . equals ( TransactionStatus . ACTIVE ) ) { txn . commit ( ) ; } }
If transaction is present and active then commit .