1 | if ( status == Status.STATUS_MARKED_ROLLBACK ) {↵ | | 1 | if ( status == Status.STATUS_MARKED_ROLLBACK ) {↵
|
2 | log.trace( "on commit, status was marked for rollback-only" );↵ | | 2 | log.trace( "on commit, status was marked for rollback-only" );↵
|
3 | rollback();↵ | | 3 | rollback();↵
|
4 | }↵ | | 4 | }↵
|
5 | else {↵ | | 5 | else {↵
|
6 | status = Status.STATUS_PREPARING;↵ | | 6 | status = Status.STATUS_PREPARING;↵
|
|
7 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | | 7 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵
|
8 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | | 8 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵
|
9 | s.beforeCompletion();↵ | | 9 | s.beforeCompletion();↵
|
10 | }↵ | | 10 | }↵
|
|
11 | status = Status.STATUS_COMMITTING;↵ | | 11 | status = Status.STATUS_COMMITTING;↵
|
|
12 | if ( connection != null ) {↵ | | 12 | if ( connection != null ) {↵
|
13 | try {↵ | | 13 | try {↵
|
14 | connection.commit();↵ | | 14 | connection.commit();↵
|
15 | connection.close();↵ | | 15 | connection.close();↵
|
16 | }↵ | | 16 | }↵
|
17 | catch ( SQLException sqle ) {↵ | | 17 | catch ( SQLException sqle ) {↵
|
18 | status = Status.STATUS_UNKNOWN;↵ | | 18 | status = Status.STATUS_UNKNOWN;↵
|
19 | throw new SystemException();↵ | | 19 | throw new SystemException();↵
|
20 | }↵ | | 20 | }↵
|
21 | }↵ | | 21 | }↵
|
|
22 | status = Status.STATUS_COMMITTED;↵ | | 22 | status = Status.STATUS_COMMITTED;↵
|
|
23 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵ | | 23 | for ( int i = 0; i < synchronizations.size(); i++ ) {↵
|
24 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵ | | 24 | Synchronization s = ( Synchronization ) synchronizations.get( i );↵
|
25 | s.afterCompletion( status );↵ | | 25 | s.afterCompletion( status );↵
|
26 | }↵ | | 26 | }↵
|
|
27 | //status = Status.STATUS_NO_TRANSACTION;↵ | | 27 | //status = Status.STATUS_NO_TRANSACTION;↵
|
28 | jtaTransactionManager.endCurrent( this );↵ | | 28 | jtaTransactionManager.endCurrent( this );↵
|
29 | } | | 29 | }
|