1 | public boolean wasRolledBack() throws TransactionException {↵ | | 1 | public boolean wasCommitted() throws TransactionException {↵
|
2 | final int status;↵ | | 2 | final int status;↵
|
3 | try {↵ | | 3 | try {↵
|
4 | status = userTransaction.getStatus();↵ | | 4 | status = userTransaction.getStatus();↵
|
5 | }↵ | | 5 | }↵
|
6 | catch ( SystemException se ) {↵ | | 6 | catch ( SystemException se ) {↵
|
7 | log.error( "Could not determine transaction status", se );↵ | | 7 | log.error( "Could not determine transaction status", se );↵
|
8 | throw new TransactionException( "Could not determine transaction status", se );↵ | | 8 | throw new TransactionException( "Could not determine transaction status: ", se );↵
|
9 | }↵ | | 9 | }↵
|
10 | if ( status == Status.STATUS_UNKNOWN ) {↵ | | 10 | if ( status == Status.STATUS_UNKNOWN ) {↵
|
11 | throw new TransactionException( "Could not determine transaction status" );↵ | | 11 | throw new TransactionException( "Could not determine transaction status" );↵
|
12 | }↵ | | 12 | }↵
|
13 | else {↵ | | 13 | else {↵
|
14 | return JTAHelper.isRollback( status );↵ | | 14 | return status == Status.STATUS_COMMITTED;↵
|
15 | | | 15 |
|