docs: final TxCookieImpl beginLocalTx(EJBKey ejbKey, EJBMethodInfoImpl methodInfo, Transaction suspendedGlobalTx)
                      throws CSIException
      {
          BeanMetaData bmd = methodInfo.getBeanMetaData();
          final int EJBType = bmd.getEJBComponentType();
          final LocalTransactionSettings ltcSettings = bmd._localTran;
          final boolean ltcBoundaryIsAS = ltcSettings.getBoundary() == LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION; // d171555.3.2
  
          boolean suspendedLocalTxFound = false;
  
          // LIDB2446: reference to local tx suspended during this method
          LocalTransactionCoordinator savedLocalTx = null;
          boolean begunLocalTx = false;
  
          // If this is an EJB 2.0 (or newer) SFSB or EntityBean which is configured
          // for local transactions with duration longer than method (ie. boundary =
          // ActivitySession, there might be a sticky local TX which we should resume now.
          // Note that EJB 1.1 beans never have local tx boundary = ActivitySession.
          // This is enforced by a check in BeanMetaData.
  
          if (ltcBoundaryIsAS && //d135218 d171555.3.2
              (EJBType == InternalConstants.TYPE_STATEFUL_SESSION ||
               EJBType == InternalConstants.TYPE_BEAN_MANAGED_ENTITY ||
              EJBType == InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY)) {
  
              LocalTransactionCoordinator suspendedLocalTx = txCtrl.stickyLocalTxTable.remove(ejbKey);
  
              if (suspendedLocalTx != null) {
                  suspendedLocalTxFound = true;
                  try
                  {
                      // LIDB2446 save any existing local tran prior to resuming sticky ltc
                      savedLocalTx = suspendLocalTx();
  
                      resumeLocalTx(suspendedLocalTx);
  
                      // LIDB2446: remember local tx 'started'
                      begunLocalTx = true;
  
                  } catch (Throwable ex) {
                      FFDCFilter.processException(ex, CLASS_NAME + ".beginLocalTx",
                                                  "200", this);
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                          Tr.event(tc, "Local tx resume failed", ex);
                      }
  
                      // LIDB2446: have to restore any suspended local tx here
                      if (savedLocalTx != null)
                      {
                          try
                          {
                              resumeLocalTx(savedLocalTx);
                          } catch (Throwable ex2) {
                              FFDCFilter.processException(ex2, CLASS_NAME + ".beginLocalTx",
                                                          "212", this);
                              if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                                  Tr.event(tc, "Saved local tx resume failed", ex2);
                              }
                          }
                      }
  
                      throw new CSIException("Resume local tx failed", ex);
                  }
  
              }
  
          } // end if EJB 2.0+, SFSB or Entity Bean, with local tx boundary = ActivitySession
  
          // If we didn't find a sticky local TX to resume, begin a new Local Tx now
  
          if (!suspendedLocalTxFound) {
  
              try {
                  //PK16329: Begins
                  //PK16329: Ooops, prior to PK16329, the begin of an ltc was like this:
                  //   ltcCurrent.begin(ltcBoundaryIsAS);
                  //It seems someone forgot to get the "unresolved action" and "resolver"
                  //from the bean meta data.  Therefore, the transaction guys were always
                  //getting the default "unresolved action" and "resolver" even if the user
                  //set specific values in these fields.  Lets call the 'begin' that takes
                  //these values as parameters:
                  //First, get the "unresolved action" as a boolean
                  final boolean ltcUnresActionIsCommit = ltcSettings.getUnresolvedAction() == LocalTransactionSettings.UNRESOLVED_COMMIT;
  
                  //Second, get the "resolver" as a boolean
                  final boolean ltcResolverIsCAB = ltcSettings.getResolver() == LocalTransactionSettings.RESOLVER_CONTAINER_AT_BOUNDARY;
  
                  // LIDB2446: check for shareable LTC
                  final boolean ltcShareable = ltcSettings.isShareable();
                  LocalTransactionCoordinator coord = ltcCurrent.getLocalTranCoord();
  
                  if (coord == null)
                  {
                      // call the begin method that takes "unresolved action" and "resolver"
                      if (ltcShareable)
                          ltcCurrent.beginShareable(ltcBoundaryIsAS, ltcUnresActionIsCommit, ltcResolverIsCAB);
                      else
                          ltcCurrent.begin(ltcBoundaryIsAS, ltcUnresActionIsCommit, ltcResolverIsCAB); // 118180, 120870.3 d171555.3.2 PK16329
                      //PK16329: Ends
  
                      svUOWSynchReg.putResource("com.ibm.websphere.profile", // d458031
                                                methodInfo.getJPATaskName()); // d515803
                      begunLocalTx = true;
                  }
                  else if (coord.isShareable() && ltcShareable)
                  {
                      // nothing to do ... this context shared
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                          Tr.event(tc, "LTC context shared");
                  }
                  else
                  {
                      // suspend current and begin new ltc
                      savedLocalTx = suspendLocalTx();
  
                      if (ltcShareable)
                          ltcCurrent.beginShareable(ltcBoundaryIsAS, ltcUnresActionIsCommit, ltcResolverIsCAB);
                      else
                          ltcCurrent.begin(ltcBoundaryIsAS, ltcUnresActionIsCommit, ltcResolverIsCAB); // 118180, 120870.3 d171555.3.2 PK16329
  
                      svUOWSynchReg.putResource("com.ibm.websphere.profile", // d458031
                                                methodInfo.getJPATaskName()); // d515803
                      begunLocalTx = true;
                  }
  
                  // d171555.3.2 Begins
                  if (TraceComponent.isAnyTracingEnabled() && // d527372
                      (tc.isEventEnabled() ||
                      TETxLifeCycleInfo.isTraceEnabled()))
                  {
                      LocalTransactionCoordinator lCoord = txCtrl.getLocalCoord(); // d165585
  
                      if (tc.isEventEnabled())
                      {
                          if (lCoord != null) {
                              Tr.event(tc, "Began LTC cntxt: tid=" +
                                           Integer.toHexString(lCoord.hashCode()) + "(LTC)");
                          } else {
                              Tr.event(tc, "Began LTC cntxt: " + "null Coordinator!");
                          }
                          if (begunLocalTx)
                          {
                              Tr.event(tc, "Set JPA task name: " + methodInfo.getJPATaskName());
                          }
                      }
                      // d165585 Begins
                      if (lCoord != null && TETxLifeCycleInfo.isTraceEnabled()) // d171555.3.2
                      {
                          TETxLifeCycleInfo.traceLocalTxBegin
                                          ("" + System.identityHashCode(lCoord), "Begin Local Tx");
                      }
                      // d165585 Ends
                  }
                  // d171555.3.2 Ends
              } catch (Exception ex) {
                  FFDCFilter.processException(ex, CLASS_NAME + ".beginLocalTx", "217", this);
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                      Tr.event(tc, "Begin local tx failed", ex);
                  }
  
                  // LIDB2446: have to restore any suspended local tx here
                  if (savedLocalTx != null)
                  {
                      try
                      {
                          resumeLocalTx(savedLocalTx);
                      } catch (Throwable ex2) {
                          FFDCFilter.processException(ex2, CLASS_NAME + ".beginLocalTx",
                                                      "242", this);
                          if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                              Tr.event(tc, "Saved local tx resume failed", ex2);
                          }
                      }
                  }
  
                  throw new CSIException("Begin local tx failed", ex);
              }
          }
  
          // LIDB2446: return cookie
          TxCookieImpl cookie = new TxCookieImpl(begunLocalTx, true, this, suspendedGlobalTx);
          cookie.suspendedLocalTx = savedLocalTx;
          return cookie;
      }