code: @Override
      public void acknowledge() throws IllegalStateRuntimeException, JMSRuntimeException {
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(this, tc, "acknowledge");
  
          try {
  
              if (jmsSession == null) {
                  IllegalStateException ise = (javax.jms.IllegalStateException) JmsErrorUtils.newThrowable(javax.jms.IllegalStateException.class,
                                                                                                           "INVALID_FOR_UNCONSUMED_MSG_CWSIA0110",
                                                                                                           new Object[] { "acknowledge" },
                                                                                                           tc
                                  );
                  throw (IllegalStateRuntimeException) JmsErrorUtils.getJMS2Exception(ise, IllegalStateRuntimeException.class);
              }
  
              synchronized (jmsSession.getSessionSyncLock()) { // lock on the jmssession's sessionSyncLock
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(this, tc, "got lock");
  
                  // Throw an exception if the session is closed.
                  jmsSession.checkNotClosed();
  
                  // throw an exception if the acknowledge method conflicts with async usage
                  jmsSession.checkSynchronousUsage("acknowledge");
  
                  // Perform the appropriate action for session's ack mode. The action for
                  // a dups ok session in JMS1.1 was somewhat unspecified, so choose to commit.
                  // But in JMS2.0 clearly commit is only for the client ack mode
                  int sessAck = jmsSession.getAcknowledgeMode();
                  if ((sessAck == Session.CLIENT_ACKNOWLEDGE)) {
                      jmsSession.commitTransaction();
                  }
              }
  
          } catch (IllegalStateException ise) {
              throw (IllegalStateRuntimeException) JmsErrorUtils.getJMS2Exception(ise, IllegalStateRuntimeException.class);
  
          } catch (JMSException jmse) {
              throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
          } finally {
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  SibTr.exit(this, tc, "acknowledge");
          }
  
      }
docs: /*
  (non-Javadoc)
  
  @see javax.jms.JMSContext#acknowledge()