Get sharding transaction manager.

@param transactionType transaction type
@return sharding transaction manager
327578
public ShardingTransactionManager getTransactionManager(final TransactionType transactionType) {
        ShardingTransactionManager result = transactionManagerMap.get(transactionType);
        if (TransactionType.LOCAL != transactionType) {
            Preconditions.checkNotNull(result, "Cannot find transaction manager of [%s]", transactionType);
        }
        return result;
    }
1054425
private static Configuration injectTransactionManager(TransactionManagerLookupDelegator transactionManagerLookupDelegator, Configuration configuration) {
		if ( configuration.transaction().transactionMode() == TransactionMode.TRANSACTIONAL ) {
			ConfigurationBuilder builder = new ConfigurationBuilder().read( configuration );
			builder.transaction()
					.transactionManagerLookup( transactionManagerLookupDelegator );
			return builder.build();
		}
		return configuration;
	}
839330
@Override
	public List<Object> getServices(Class<?> root,Class<?> transactionType){
		Map<Class<?>, List<Object>> map = mapBusinessProvider.get(root);
		if(map != null){
			List<Object> list = map.get(transactionType);
			if(list != null){
				return Collections.unmodifiableList(list);
			}
		}
		return null;
	}
835644
public final Transaction getTransaction()
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "getTransaction"
                            );
        // If the log is full introduce a delay for a checkpoiunt before allowing the 
        // application to proceed.
        objectManagerState.transactionPacing();
        Transaction transaction = objectManagerState.getTransaction();

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "getTransaction"
                       , "returns transaction=" + transaction + "(Transaction)"
                            );
        return transaction;
    }
677567
public javax.transaction.Transaction getJTATransaction()
    {
        if(tm == null)
        {
            try
            {
                tm = TransactionManagerFactoryFactory.instance().getTransactionManager();
            }
            catch (TransactionManagerFactoryException e)
            {
                throw new TransactionFactoryException("Can't instantiate TransactionManagerFactory", e);
            }
        }
        try
        {
            return tm.getTransaction();
        }
        catch(SystemException e)
        {
            throw new TransactionFactoryException("Error acquiring JTA Transaction", e);
        }
    }
133169
protected function verifyTransactionType($transactionType, $parameters = [])
    {
        if (!Types::isValidWPFTransactionType($transactionType)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Transaction type (%s) is not valid. Valid WPF transactions are: %s.',
                    $transactionType,
                    implode(', ', Types::getWPFTransactionTypes())
                )
            );
        }

        $txnCustomRequiredParams = Types::getCustomRequiredParameters(
            $transactionType
        );

        if (!CommonUtils::isValidArray($txnCustomRequiredParams)) {
            return;
        }

        $txnCustomRequiredParams = static::validateNativeCustomParameters($transactionType, $txnCustomRequiredParams);

        if (CommonUtils::isValidArray($txnCustomRequiredParams) && !CommonUtils::isValidArray($parameters)) {
            throw new \Genesis\Exceptions\ErrorParameter(
                sprintf(
                    'Custom transaction parameters (%s) are required and none are set.',
                    implode(', ', array_keys($txnCustomRequiredParams))
                )
            );
        }

        foreach ($txnCustomRequiredParams as $customRequiredParam => $customRequiredParamValues) {
            $this->validateRequiredParameter(
                $transactionType,
                $customRequiredParam,
                $customRequiredParamValues,
                $parameters
            );
        }
    }
779533
public static function transactionTypeToServiceName($transactionType)
    {
        switch ($transactionType) {
            case HpsTransactionType::AUTHORIZE:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_AUTH;
                break;
            case HpsTransactionType::CAPTURE:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_ADD_TO_BATCH;
                break;
            case HpsTransactionType::CHARGE:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_SALE;
                break;
            case HpsTransactionType::REFUND:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_RETURN;
                break;
            case HpsTransactionType::REVERSE:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_REVERSAL;
                break;
            case HpsTransactionType::VERIFY:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_ACCOUNT_VERIFY;
                break;
            case HpsTransactionType::LIST_TRANSACTION:
                return HpsItemChoiceTypePosResponseVer10Transaction::REPORT_ACTIVITY;
                break;
            case HpsTransactionType::GET:
                return HpsItemChoiceTypePosResponseVer10Transaction::REPORT_TXN_DETAIL;
                break;
            case HpsTransactionType::VOID:
                return HpsItemChoiceTypePosResponseVer10Transaction::CREDIT_VOID;
                break;
            case HpsTransactionType::BATCH_CLOSE:
                return HpsItemChoiceTypePosResponseVer10Transaction::BATCH_CLOSE;
                break;
            case HpsTransactionType::SECURITY_ERROR:
                return "SecurityError";
                break;
            default:
                return "";
        }
    }
278197
protected Filter getTransactionFilter(Transaction tx, ScanType type, Filter filter) {
    return TransactionFilters.getVisibilityFilter(tx, ttlByFamily, allowEmptyValues, type, filter);
  }
644113
public <T> T withTransaction(@NotNull TransactionSettings settings,
                                 @NotNull TransactionCallback<T> callback) {

        return transactionManager.withTransaction(settings, callback, dialect);
    }
606908
public final int getTransactionType()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "getTransactionType");
            SibTr.exit(this, tc, "getTransactionType", "return=TX_GLOBAL");
        }
        return TX_GLOBAL;
    }
1002222
protected function validateNativeCustomParameters($transactionType, $txnCustomRequiredParams)
    {
        foreach ($txnCustomRequiredParams as $customRequiredParam => $customRequiredParamValues) {
            if (property_exists($this, $customRequiredParam)) {
                $this->validateRequiredParameter(
                    $transactionType,
                    $customRequiredParam,
                    $customRequiredParamValues,
                    [ $customRequiredParam => $this->{$customRequiredParam} ]
                );

                unset($txnCustomRequiredParams[$customRequiredParam]);
            }
        }

        return $txnCustomRequiredParams;
    }
149179
public function getTransactionDataFromOrder(
        $sTransactionType = TPkgShopPaymentTransactionData::TYPE_PAYMENT,
        $aProductAmountRestriction = null,
        $bUseConfirmedTransactionsOnly = true
    ) {
        $dSignMultiplier = 1;
        if (TPkgShopPaymentTransactionData::TYPE_PAYMENT === $sTransactionType) {
            $aItemBaseToUse = $this->getBillableProducts($bUseConfirmedTransactionsOnly);
        } else {
            $aItemBaseToUse = $this->getRefundableProducts($bUseConfirmedTransactionsOnly);
        }

        $oTransactionData = new TPkgShopPaymentTransactionData($this->order, $sTransactionType);
        $dOrderTotal = 0;
        $dProductValue = 0;
        $bAllRemainingItemsSelected = true;
        $dDiscount = 0;

        $orderItems = $this->order->GetFieldShopOrderItemList();
        foreach ($aItemBaseToUse as $sShopOrderItemId => $iAmountAllowedForUse) {
            $iAmountForTransaction = $iAmountAllowedForUse;
            if (null !== $aProductAmountRestriction) {
                if (false === isset($aProductAmountRestriction[$sShopOrderItemId])) {
                    $bAllRemainingItemsSelected = false; // some items were skipped
                    continue;
                }

                $iAmountForTransaction = $dSignMultiplier * $aProductAmountRestriction[$sShopOrderItemId];

                if ($iAmountForTransaction > $iAmountAllowedForUse) {
                    $sMsg = "trying to use {$iAmountForTransaction} from item {$sShopOrderItemId} when only {$iAmountAllowedForUse} are available";
                    throw new TPkgCmsException_LogAndMessage(
                        TPkgShopPaymentTransactionManager::MESSAGE_ERROR,
                        array('sMessage' => $sMsg),
                        $sMsg,
                        array('order' => $this->order->sqlData)
                    );
                }
            }
            $oOrderItem = $orderItems->FindItemWithProperty('id', $sShopOrderItemId);
            if (false === $oOrderItem) {
                $sMsg = "unable to load the shop_order_item [{$this->order->id}] in order [{$sShopOrderItemId}]";
                throw new TPkgCmsException_LogAndMessage(
                    TPkgShopPaymentTransactionManager::MESSAGE_ERROR,
                    array('sMessage' => $sMsg),
                    $sMsg,
                    array('order' => $this->order->sqlData)
                );
            }

            //$totalQuantityForTransaction = $this->gettot
            $oItem = new TPkgShopPaymentTransactionItemData();
            $oItem
                ->setType(TPkgShopPaymentTransactionItemData::TYPE_PRODUCT)
                ->setAmount($dSignMultiplier * $iAmountForTransaction)
                ->setOrderItemId($sShopOrderItemId)
                ->setValue($oOrderItem->fieldOrderPrice);
            if (0 != $oItem->getAmount()) {
                $oTransactionData->addItem($oItem);
                $dOrderTotal += $oItem->getAmount() * $oItem->getValue();
                $dProductValue += $oItem->getAmount() * $oItem->getValue();
                $dDiscount += round(
                        (($oOrderItem->fieldOrderPriceAfterDiscounts / $oOrderItem->fieldOrderAmount) * $iAmountForTransaction),
                        2
                    ) - ($dSignMultiplier * $oItem->getAmount() * $oItem->getValue());
            }
            $bAllRemainingItemsSelected = $bAllRemainingItemsSelected && ($iAmountForTransaction == $iAmountAllowedForUse);
        }

        if ($dDiscount > 0 || $dDiscount < 0) {
            $oItem = new TPkgShopPaymentTransactionItemData();
            $oItem
                ->setType(TPkgShopPaymentTransactionItemData::TYPE_DISCOUNT)
                ->setAmount($dSignMultiplier)
                ->setValue($dDiscount);
            $oTransactionData->addItem($oItem);
            $dOrderTotal = $dOrderTotal + ($oItem->getAmount() * $oItem->getValue());
        }

        // shipping, payment, vouchers and "other" should always be used as quickly as possible
        $dShippingPrice = $this->order->fieldShopShippingGroupPrice - $this->getTransactionPositionTotalForType(
                TPkgShopPaymentTransactionItemData::TYPE_SHIPPING,
                true
            );
        if ($dShippingPrice > 0 || $dShippingPrice < 0) {
            $oItem = new TPkgShopPaymentTransactionItemData();
            $oItem
                ->setType(TPkgShopPaymentTransactionItemData::TYPE_SHIPPING)
                ->setAmount($dSignMultiplier)
                ->setValue($dShippingPrice);
            $oTransactionData->addItem($oItem);
            $dOrderTotal = $dOrderTotal + ($oItem->getAmount() * $oItem->getValue());
        }

        $dPaymentMethodPrice = $this->order->fieldShopPaymentMethodPrice - $this->getTransactionPositionTotalForType(
                TPkgShopPaymentTransactionItemData::TYPE_PAYMENT,
                true
            );
        if ($dPaymentMethodPrice > 0 || $dPaymentMethodPrice < 0) {
            $oItem = new TPkgShopPaymentTransactionItemData();
            $oItem
                ->setType(TPkgShopPaymentTransactionItemData::TYPE_PAYMENT)
                ->setAmount($dSignMultiplier)
                ->setValue($dPaymentMethodPrice);
            $oTransactionData->addItem($oItem);
            $dOrderTotal = $dOrderTotal + ($oItem->getAmount() * $oItem->getValue());
        }

        $dVoucher = $this->getTransactionOrderDataVoucherValue($sTransactionType, $dOrderTotal);

        if ($dVoucher > 0 || $dVoucher < 0) {
            $oItem = new TPkgShopPaymentTransactionItemData();
            $oItem
                ->setType(TPkgShopPaymentTransactionItemData::TYPE_VOUCHER)
                ->setAmount($dSignMultiplier)
                ->setValue($dVoucher);
            $oTransactionData->addItem($oItem);
            $dOrderTotal = $dOrderTotal + ($oItem->getAmount() * $oItem->getValue());
        }

        $dExpectedTotal = $dSignMultiplier * $this->getOrderTotalOtherValue();

        $dOther = $dExpectedTotal - $this->getTransactionPositionTotalForType(
                TPkgShopPaymentTransactionItemData::TYPE_OTHER,
                true
            );

        if ($dOther > 0 || $dOther < 0) {
            $oItem = new TPkgShopPaymentTransactionItemData();
            $oItem
                ->setType(TPkgShopPaymentTransactionItemData::TYPE_OTHER)
                ->setAmount($dSignMultiplier)
                ->setValue($dOther);
            $oTransactionData->addItem($oItem);
            $dOrderTotal = $dOrderTotal + ($oItem->getAmount() * $oItem->getValue());
        }

        $oTransactionData->setTotalValue($dOrderTotal);

        return $oTransactionData;
    }
210856
public Transaction getTransaction(final String transactionId) {
        if (transactionId == null || transactionId.isEmpty())
            throw new RuntimeException("transactionId cannot be empty!");

        return doGET(Transactions.TRANSACTIONS_RESOURCE + "/" + transactionId,
                     Transaction.class);
    }
1106681
public ActivationStrategy getActivationStrategy(int type,
                                                    Activator activator,
                                                    PassivationPolicy passivationPolicy,
                                                    SfFailoverCache failoverCache) //LIDB2018-1
    {
        ActivationStrategy as = null;
        if (type == Activator.ENTITY_SESSIONAL_TRAN_ACTIVATION_STRATEGY) {
            as = activator.getActivationStrategy(Activator.OPTC_ENTITY_ACTIVATION_STRATEGY); // d127328
        }
        else if (type == Activator.STATEFUL_ACTIVATE_SESSION_ACTIVATION_STRATEGY) {
            as = activator.getActivationStrategy(Activator.STATEFUL_ACTIVATE_TRAN_ACTIVATION_STRATEGY); // d127328
        }
        return as;
    }
607670
public <T extends Mapping> T getMapping(MappingType type)
    {
        return (T) mappings.get(type);
    }
1366711
public Object doGetTransaction() throws TransactionException {
		CompensatingTransactionHolderSupport holder = (CompensatingTransactionHolderSupport) TransactionSynchronizationManager
				.getResource(getTransactionSynchronizationKey());
        return new CompensatingTransactionObject(holder);
	}
1328555
public Optional<MapperInstance> getKeyDeserializer( JType type ) {
        return Optional.fromNullable( keyDeserializers.get( type.getQualifiedSourceName() ) );
    }