@Override
    public void commit() throws JMSException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "commit");

        synchronized (sessionSyncLock) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "got lock");

            // throw an exception if the session is closed.
            checkNotClosed();
            // throw an exception if the session is async
            checkSynchronousUsage("commit");
            // throw an exception if the session is not transacted.
            if (acknowledgeMode != Session.SESSION_TRANSACTED) {
                throw (javax.jms.IllegalStateException) JmsErrorUtils.newThrowable(
                                                                                   javax.jms.IllegalStateException.class,
                                                                                   "INVALID_OP_FOR_NONTRANS_SESSION_CWSIA0042",
                                                                                   new Object[] { "commit" },
                                                                                   tc);
            }

            //if it is non-managed environment.. we have to check that this call should not have made from owning context
            // and has to wait till all Async sends are resolved.
            if (!isManaged) {

                validateCloseCommitRollback("commit");

                //wait till all Async sends are resolved on this Session. 
                waitForAsyncSendCompletion();
            }

            // commit the current transaction.
            commitTransaction();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "commit");
    }
@ Override public void commit ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "commit" ) ; synchronized ( sessionSyncLock ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "got lock" ) ; checkNotClosed ( ) ; checkSynchronousUsage ( "commit" ) ; if ( acknowledgeMode != Session . SESSION_TRANSACTED ) { throw ( javax . jms . IllegalStateException ) JmsErrorUtils . newThrowable ( javax . jms . IllegalStateException . class , "INVALID_OP_FOR_NONTRANS_SESSION_CWSIA0042" , new Object [ ] { "commit" } , tc ) ; } if ( ! isManaged ) { validateCloseCommitRollback ( "commit" ) ; waitForAsyncSendCompletion ( ) ; } commitTransaction ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "commit" ) ; }
@see javax.jms.Session#commit()