docs: @Override
      public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(this, tc, "createSession", new Object[] { transacted, acknowledgeMode });
  
          JmsSessionImpl jmsSession = null;
  
          // throw an exception if the connection is closed.
          checkClosed();
  
          // mark that the client id cannot be changed.
          fixClientID();
  
          // enforce consistency on transacted flag and acknowledge mode.
          if (transacted) {
              acknowledgeMode = Session.SESSION_TRANSACTED;
          }
          if (!transacted && isManaged) {
              if (acknowledgeMode == Session.CLIENT_ACKNOWLEDGE) {
                  throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class,
                                                                  "INVALID_ACKNOWLEDGE_MODE_CWSIA0514",
                                                                  new Object[] { acknowledgeMode },
                                                                  tc
                                  );
              }
              // if the ackmode is dups_ok then set it to dups_ok, for all the other combination 
              // set it to auto_ack
              if (acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE)
                  acknowledgeMode = Session.DUPS_OK_ACKNOWLEDGE;
              else
                  acknowledgeMode = Session.AUTO_ACKNOWLEDGE;
          }
  
          // create the jca session.
          boolean internallyTransacted = (transacted
                                          || acknowledgeMode == Session.CLIENT_ACKNOWLEDGE
                                          || acknowledgeMode == Session.DUPS_OK_ACKNOWLEDGE);
          JmsJcaSession jcaSession = createJcaSession(internallyTransacted);
  
          // Lock here so that another thread using the same connection doesn't reset the 
          // coreConnection to something else as as we are instantiating the Session 
          synchronized (this)
          {
              try
              {
                  // We potentially have a new coreConnection becuase the creation of the JcaSession
                  // detected that the coreConnection is now invalid and so a new managedConnection
                  // and coreConnection was created. So reset the coreConnection for this JmsConnection
                  // to the new one or we just set the old one again.
                  coreConnection = jcaSession.getSICoreConnection();
              } catch (IllegalStateException e)
              {
                  FFDCFilter.processException(e, "com.ibm.ws.sib.api.jms.impl.JmsConnectionImpl", "createSession#2", this);
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(this, tc, "createSession", jmsSession);
  
                  throw (JMSException) JmsErrorUtils.newThrowable(
                                                                  JMSException.class,
                                                                  "JCA_CREATE_SESS_CWSIA0024",
                                                                  null,
                                                                  e,
                                                                  "JmsConnectionImpl.createSession#2",
                                                                  this,
                                                                  tc);
              }
              // instantiate the jms session, and add it to this connection's session list.
              jmsSession = instantiateSession(transacted, acknowledgeMode, coreConnection, jcaSession);
          }
          synchronized (stateLock) {
              sessions.add(jmsSession);
              // d353701 - output a warning message if there are 'lots' of sessions active.
              if (sessions.size() % SESSION_WARNING_THRESHOLD == 0) {
                  // We wish to tell the user which line of their application created the session,
                  // so we must obtain a line of stack trace from their application.
                  String errorLocation = JmsErrorUtils.getFirstApplicationStackString();
                  SibTr.warning(tc, "MANY_SESSIONS_WARNING_CWSIA0027", new Object[] { "" + sessions.size(), errorLocation });
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(this, tc, "createSession", jmsSession);
          return jmsSession;
      }