public void commitOnePhase() throws XAException
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "commitOnePhase", _txn);

        final int state = _txn.getTransactionState().getState();

        switch (state)
        {
            case TransactionState.STATE_ACTIVE :
                // Suspend local transaction if present
                suspend();

                try
                {
                    // Resume imported transaction
                    _tranManager.resume(_txn);
                    _txn.prolongFinish();
                    _txn.commit_one_phase();
                    _txn.notifyCompletion();
                }
                catch (RollbackException e)
                {
                    _txn.notifyCompletion();
                    if (tc.isEntryEnabled()) Tr.exit(tc, "commitOnePhase", "commit threw RollbackException");
                    throw new XAException(XAException.XA_RBROLLBACK);
                }
                catch (HeuristicMixedException e)
                {
                    _heuristic = StatefulResource.HEURISTIC_MIXED;
                }
                catch (HeuristicHazardException e)
                {
                    _heuristic = StatefulResource.HEURISTIC_HAZARD;
                }
                catch (HeuristicRollbackException e)
                {
                    _heuristic = StatefulResource.HEURISTIC_ROLLBACK;
                }
                catch (IllegalStateException e)
                {
                    _txn.notifyCompletion();
                    if (tc.isEntryEnabled()) Tr.exit(tc, "commitOnePhase", "commit threw IllegalStateException");
                    throw new XAException(XAException.XAER_PROTO);
                }
                catch (InvalidTransactionException e) // tm.resume
                {
                    if (tc.isEntryEnabled()) Tr.exit(tc, "commitOnePhase", "commit threw InvalidTransactionException");
                    throw new XAException(XAException.XAER_RMERR);
                }
                catch (SystemException e)
                {
                    _txn.notifyCompletion();
                    if (tc.isEntryEnabled()) Tr.exit(tc, "commitOnePhase", "commit threw SystemException");
                    throw new XAException(XAException.XAER_RMERR);
                }
                finally
                {
                    // Resume local transaction if we suspended it earlier
                    resume();
                }

                break;

            case TransactionState.STATE_COMMITTING :
            case TransactionState.STATE_COMMITTED :
                // probably a retry, just accept
                break;

            case TransactionState.STATE_ROLLING_BACK :
            case TransactionState.STATE_ROLLED_BACK :
            case TransactionState.STATE_HEURISTIC_ON_ROLLBACK :
                _heuristic = StatefulResource.HEURISTIC_ROLLBACK;
                break;

            case TransactionState.STATE_HEURISTIC_ON_COMMIT :
                _heuristic = StatefulResource.HEURISTIC_COMMIT;
                break;

            case TransactionState.STATE_NONE :
                // transaction has completed and is now finished
                break;

            default :
                if (tc.isEntryEnabled()) Tr.exit(tc, "commitOnePhase", "transaction is in an incorrect state");
                throw new XAException(XAException.XAER_PROTO);
        }
        
        recordHeuristicOnCommitOnePhase();


        if (tc.isEntryEnabled()) Tr.exit(tc, "commitOnePhase");
    }
public void commitOnePhase ( ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "commitOnePhase" , _txn ) ; final int state = _txn . getTransactionState ( ) . getState ( ) ; switch ( state ) { case TransactionState . STATE_ACTIVE : suspend ( ) ; try { _tranManager . resume ( _txn ) ; _txn . prolongFinish ( ) ; _txn . commit_one_phase ( ) ; _txn . notifyCompletion ( ) ; } catch ( RollbackException e ) { _txn . notifyCompletion ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commitOnePhase" , "commit threw RollbackException" ) ; throw new XAException ( XAException . XA_RBROLLBACK ) ; } catch ( HeuristicMixedException e ) { _heuristic = StatefulResource . HEURISTIC_MIXED ; } catch ( HeuristicHazardException e ) { _heuristic = StatefulResource . HEURISTIC_HAZARD ; } catch ( HeuristicRollbackException e ) { _heuristic = StatefulResource . HEURISTIC_ROLLBACK ; } catch ( IllegalStateException e ) { _txn . notifyCompletion ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commitOnePhase" , "commit threw IllegalStateException" ) ; throw new XAException ( XAException . XAER_PROTO ) ; } catch ( InvalidTransactionException e ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commitOnePhase" , "commit threw InvalidTransactionException" ) ; throw new XAException ( XAException . XAER_RMERR ) ; } catch ( SystemException e ) { _txn . notifyCompletion ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commitOnePhase" , "commit threw SystemException" ) ; throw new XAException ( XAException . XAER_RMERR ) ; } finally { resume ( ) ; } break ; case TransactionState . STATE_COMMITTING : case TransactionState . STATE_COMMITTED : break ; case TransactionState . STATE_ROLLING_BACK : case TransactionState . STATE_ROLLED_BACK : case TransactionState . STATE_HEURISTIC_ON_ROLLBACK : _heuristic = StatefulResource . HEURISTIC_ROLLBACK ; break ; case TransactionState . STATE_HEURISTIC_ON_COMMIT : _heuristic = StatefulResource . HEURISTIC_COMMIT ; break ; case TransactionState . STATE_NONE : break ; default : if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commitOnePhase" , "transaction is in an incorrect state" ) ; throw new XAException ( XAException . XAER_PROTO ) ; } recordHeuristicOnCommitOnePhase ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "commitOnePhase" ) ; }
Informs the object that the transaction is to be committed in one-phase

@exception XAException thrown with the following error codes:
<ul><li>XA_RBROLLBACK - the transaction has rolled back</li>
<li>XA_HEURHAZ - the transaction branch may have been heuristically committed</li>
<li>XA_HEURRB - the transaction branch has been heuristically rolled back</li>
<li>XAER_PROTO - the routine was invoked in an inproper context</li>
<li>XA_RMERR - a resource manager error has occurred</li></ul>

@see javax.transaction.xa.XAException