Method createGDProtocolItemStreams
@param transaction
@throws OutOfCacheSpace
@throws MessageStoreException
@throws SIResourceException
6292
public void createGDProtocolItemStreams(TransactionCommon transaction)
    throws OutOfCacheSpace,MessageStoreException, SIResourceException                                                         
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createGDProtocolItemStreams");
    
    Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);
    _targetProtocolItemStream = new TargetProtocolItemStream(_baseDestinationHandler, msTran);
    _sourceProtocolItemStream = new SourceProtocolItemStream(_baseDestinationHandler, msTran);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createGDProtocolItemStreams");
  }
1154426
@Override
  public RecordStreamWithMetadata<DO, SO> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
      WorkUnitState workUnitState) throws SchemaConversionException {
    init(workUnitState);
    this.outputGlobalMetadata = GlobalMetadata.<SI, SO>builderWithInput(inputStream.getGlobalMetadata(),
        Optional.fromNullable(convertSchema(inputStream.getGlobalMetadata().getSchema(), workUnitState))).build();
    Flowable<StreamEntity<DO>> outputStream =
        inputStream.getRecordStream()
            .flatMap(in -> {
              if (in instanceof ControlMessage) {
                ControlMessage out = (ControlMessage) in;

                getMessageHandler().handleMessage((ControlMessage) in);

                // update the output schema with the new input schema from the MetadataUpdateControlMessage
                if (in instanceof MetadataUpdateControlMessage) {
                  this.outputGlobalMetadata = GlobalMetadata.<SI, SO>builderWithInput(
                      ((MetadataUpdateControlMessage) in).getGlobalMetadata(),
                      Optional.fromNullable(convertSchema((SI)((MetadataUpdateControlMessage) in).getGlobalMetadata()
                          .getSchema(), workUnitState))).build();
                  out = new MetadataUpdateControlMessage<SO, DO>(this.outputGlobalMetadata);
                }

                return Flowable.just(((ControlMessage<DO>) out));
              } else if (in instanceof RecordEnvelope) {
                RecordEnvelope<DI> recordEnvelope = (RecordEnvelope<DI>) in;
                return convertRecordEnvelope(this.outputGlobalMetadata.getSchema(), recordEnvelope, workUnitState);
              } else {
                throw new UnsupportedOperationException();
              }
            }, 1);
    outputStream = outputStream.doOnComplete(this::close);
    return inputStream.withRecordStream(outputStream, this.outputGlobalMetadata);
  }
87390
public final void commitUpdate(PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "commitUpdate", transaction);

        AbstractItem item = null;
        boolean linkHasBecomeReleasable = false;
        synchronized (this)
        {
            if (ItemLinkState.STATE_UPDATING_DATA == _itemLinkState)
            {
                _assertCorrectTransaction(transaction);
                item = _getAndAssertItem();

                ListStatistics stats = getParentStatistics();
                synchronized (stats)
                {
                    stats.decrementUpdating();
                    stats.incrementAvailable();
                }

                linkHasBecomeReleasable = _declareDiscardable();
                _itemLinkState = ItemLinkState.STATE_AVAILABLE;
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(this, tc, "commitUpdate");
                throw new StateException(_itemLinkState.toString());
            }
            _transactionId = null;
        }
        // this stuff has to be done outside the synchronized block
        if (linkHasBecomeReleasable)
        {
            _declareReleasable(item);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "commitUpdate");
    }
450243
public void generatExecuteTransactionRx(ClassName dataSourceName, String daoFactory, RxType rxType) {
		String parameterName = "transaction";
		ParameterizedTypeName returnTypeName = ParameterizedTypeName.get(ClassName.get(rxType.clazz),
				TypeVariableName.get("T"));
		ParameterizedTypeName observableTypeName = ParameterizedTypeName.get(TypeUtility
				.className(rxType.clazz.getPackage().getName(), rxType.clazz.getSimpleName() + "OnSubscribe"),
				TypeVariableName.get("T"));
		ParameterizedTypeName emitterTypeName = ParameterizedTypeName.get(
				TypeUtility.className(rxType.clazz.getPackage().getName(), rxType.clazz.getSimpleName() + "Emitter"),
				TypeVariableName.get("T"));

		TypeSpec innerEmitter = TypeSpec.anonymousClassBuilder("").addSuperinterface(observableTypeName)
				.addMethod(MethodSpec.methodBuilder("subscribe").addAnnotation(Override.class)
						.addModifiers(Modifier.PUBLIC).addParameter(emitterTypeName, "emitter").returns(Void.TYPE)
						.addStatement("boolean needToOpened=!$L.this.isOpenInWriteMode()", dataSourceName.simpleName())
						.addStatement("boolean success=false").addCode("@SuppressWarnings(\"resource\")\n")
						.addStatement("$T connection=needToOpened ? openWritableDatabase() : database()",
								SQLiteDatabase.class)
						// support for live data
						.addStatement("$L currentDaoFactory=_daoFactorySingleThread.bindToThread()",
								DATA_SOURCE_SINGLE_THREAD_NAME)
						.addStatement("currentDaoFactory.onSessionOpened()")

						.beginControlFlow("try").addStatement("connection.beginTransaction()")
						.beginControlFlow(
								"if (transaction != null && $T.$L==transaction.onExecute(currentDaoFactory, emitter))",
								TransactionResult.class, TransactionResult.COMMIT)
						.addStatement("connection.setTransactionSuccessful()").addStatement("success=true")
						.endControlFlow().addStatement(rxType.onComplete ? "emitter.onComplete()" : "// no onComplete")

						.nextControlFlow("catch($T e)", Throwable.class)
						.addStatement("$T.error(e.getMessage())", Logger.class).addStatement("e.printStackTrace()")
						.addStatement("emitter.onError(e)")
						// support for live data
						.addStatement("currentDaoFactory.onSessionClear()").nextControlFlow("finally")
						.beginControlFlow("try").addStatement("connection.endTransaction()")
						.nextControlFlow("catch($T e)", Throwable.class).endControlFlow()
						.addCode("if (needToOpened) { close(); }\n")
						// support for live data
						.addCode(
								"if (success) { currentDaoFactory.onSessionClosed(); } else { currentDaoFactory.onSessionClear(); }\n")
						.endControlFlow().addStatement("return").build())
				.build();

		{
			MethodSpec.Builder executeMethod = MethodSpec.methodBuilder("execute").addModifiers(Modifier.PUBLIC)
					.addTypeVariable(TypeVariableName.get("T"))
					.addParameter(
							ParameterizedTypeName.get(TypeUtility.className(dataSourceName.toString(),
									rxType.clazz.getSimpleName() + "Transaction"), TypeVariableName.get("T")),
							parameterName, Modifier.FINAL)
					.returns(returnTypeName);

			executeMethod.addStatement("$T emitter=$L", observableTypeName, innerEmitter);

			if (rxType == RxType.FLOWABLE) {
				executeMethod.addStatement("$T result=$T.create(emitter, $T.BUFFER)", returnTypeName, rxType.clazz,
						BackpressureStrategy.class);
			} else {
				executeMethod.addStatement("$T result=$T.create(emitter)", returnTypeName, rxType.clazz);
			}
			executeMethod.addStatement("if (globalSubscribeOn!=null) result.subscribeOn(globalSubscribeOn)");
			executeMethod.addStatement("if (globalObserveOn!=null) result.observeOn(globalObserveOn)");

			executeMethod.addStatement("return result");

			classBuilder.addMethod(executeMethod.build());
		}

	}
1114293
public static TransactionEdit createStarted(long writePointer, long visibilityUpperBound,
                                              long expirationDate, TransactionType type) {
    return new TransactionEdit(writePointer, visibilityUpperBound, State.INPROGRESS,
                               expirationDate, null, 0L, false, type, null, 0L, 0L, null);
  }
983684
private function _submitTransaction($transaction, $txnType, $clientTransactionId = null)
    {
        $options = array();
        if ($clientTransactionId !== null) {
            $options['clientTransactionId'] = $clientTransactionId;
        }
        $rsp = $this->doRequest($transaction, $options);
        HpsGatewayResponseValidation::checkResponse($rsp, $txnType);
        $response = HpsCheckResponse::fromDict($rsp, $txnType);

        if ($response->responseCode != 0) {
            throw new HpsCheckException(
                $rsp->Header->GatewayTxnId,
                $response->details,
                $response->responseCode,
                $response->responseText
            );
        }

        return $response;
    }
689258
private TargetStream createStream(StreamSet streamSet,
                                    int priority,
                                    Reliability reliability,
                                    long completedPrefix)

                                    throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "createStream",
        new Object[] { streamSet, Integer.valueOf(priority), reliability, Long.valueOf(completedPrefix) });

    TargetStream stream = null;
    stream = createStream(streamSet, priority, reliability);
    stream.setCompletedPrefix(completedPrefix);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createStream");

    return stream;
  }
299602
public final void postAbort(final PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "postAbort", transaction);

        AbstractItem item = getItem();
        if (null == item)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "null item");
        }
        else
        {
            item.eventPostRollbackRemove(transaction);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "postAbort");
    }
415411
@Override
    public Transaction makeTransaction(byte[] payloadBytes, int offset, int length, byte[] hashFromHeader)
            throws ProtocolException {
        return new Transaction(params, payloadBytes, offset, null, this, length, hashFromHeader);
    }
823445
private void createDestinationLocalization(
                                               DestinationDefinition destinationDefinition,
                                               LocalizationDefinition destinationLocalizationDefinition,
                                               Set<String> destinationLocalizingMEs,
                                               boolean isTemporary,
                                               LocalTransaction transaction) throws SIResourceException, SIMPDestinationAlreadyExistsException
    {
//    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
//      SibTr.entry(
//        tc,
//        "createDestinationLocalization",
//        new Object[] {
//          destinationDefinition.getName(),
//          destinationDefinition.getUUID().toString(),
//          destinationDefinition,
//          destinationLocalizationDefinition,
//          destinationLocalizingMEs,
//          new Boolean(isTemporary),
//          transaction });

        boolean destinationHandlerCreated = false;
        BaseDestinationHandler destinationHandler = null;

        //The destination is being created on the local messaging engine.
        SIBUuid8 messagingEngineUuid = messageProcessor.getMessagingEngineUuid();

        checkValidLocalizationConfig(destinationDefinition,
                                     messagingEngineUuid,
                                     destinationLocalizationDefinition,
                                     destinationLocalizingMEs);

        //The lock on the destinationManager is taken to stop 2 threads creating the same
        //destination and also to synchronize dynamic deletes with the
        //creation of aliases.  This stops an alias destination being created that targets a
        //destination in the process of being deleted.
        synchronized (this)
        {
            //check if there are ANY with the same uuid
            DestinationTypeFilter filter = new DestinationTypeFilter();
            //Venu UUID temp
            DestinationHandler dh = destinationIndex.findByName(destinationDefinition.getName(), messageProcessor.getMessagingEngineBus(), filter);

            // If someone does a delete and add then it is possible the delete
            // might not have happened yet, so wait up to 5 seconds for the
            // deletion thread to finish. Then get the DH again and proceed. If
            // deletion takes more than 5 seconds this still won't work, but
            // deletion should not take 5 seconds.
            if (dh != null && dh.isToBeDeleted()) {
                synchronized (deletionThreadLock) {
                  try {
                      if (asynchDeletionThread != null && asynchDeletionThread.isRunning()) {
                          deletionThreadLock.wait(5000);
                      }
                  } catch (InterruptedException ie) {
                    // Just ignore this, someone told us to wake up so just bail.
                    Thread.currentThread().interrupt();
                    SibTr.debug(tc, "Wait for deletion thread to complete interrupted. Continuing without further waiting");
                  }
                }
                dh = destinationIndex.findByName(destinationDefinition.getName(), messageProcessor.getMessagingEngineBus(), filter);
            }

            if (dh == null)
            {
                // Create a new DestinationHandler, which is created locked
                // 174199.2.3
                destinationHandler =
                                new BaseDestinationHandler(
                                                destinationDefinition,
                                                messageProcessor,
                                                this,
                                                transaction,
                                                durableSubscriptions,
                                                messageProcessor.getMessagingEngineBus());

                destinationHandlerCreated = true;
                DestinationIndex.Type type = new DestinationIndex.Type();
                type.alias = new Boolean(destinationHandler.isAlias());
                type.foreignDestination = new Boolean(destinationHandler.isForeign());
                type.local = new Boolean(destinationHandler.hasLocal());
                type.queue = new Boolean(!destinationHandler.isPubSub());
                type.remote = new Boolean(destinationHandler.hasRemote());
                type.state = State.CREATE_IN_PROGRESS;
                //Venu temp UUID. setting UUID freshly
                destinationDefinition.setUUID(new SIBUuid12());
                destinationLocalizationDefinition.setUUID(new SIBUuid8());
                destinationIndex.put(destinationHandler, type);

            }
            else
            {
                if (dh instanceof BaseDestinationHandler) {
                    destinationHandler = (BaseDestinationHandler) dh;
                    //Venu temp UUID. setting Destination UUID from MessageStore dh
                    // LocalisationDefitnion UUID is alwasy set freshly
                    destinationDefinition.setUUID(dh.getDefinition().getUUID());
                    destinationLocalizationDefinition.setUUID(new SIBUuid8());
                }
                else
                {
                    //A destination exists with this name - perhaps an alias or a
                    //foreign destination.
                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(
                                   tc,
                                   "createDestinationLocalization",
                                   nls_cwsik.getFormattedMessage(
                                                                 "DELIVERY_ERROR_SIRC_31", // DESTINATION_ALREADY_EXISTS_ERROR_CWSIP0045
                                                                 new Object[] { destinationDefinition.getName() },
                                                                 null));

                    SIMPDestinationAlreadyExistsException e = new SIMPDestinationAlreadyExistsException(
                                    nls_cwsik.getFormattedMessage(
                                                                  "DELIVERY_ERROR_SIRC_31", // DESTINATION_ALREADY_EXISTS_ERROR_CWSIP0045
                                                                  new Object[] { destinationDefinition.getName() },
                                                                  null));

                    e.setExceptionReason(SIRCConstants.SIRC0031_DESTINATION_ALREADY_EXISTS_ERROR);
                    e.setExceptionInserts(new String[] { destinationDefinition.getName() });
                    throw e;
                }
            }
        }

        synchronized (destinationHandler)
        {
            //      // If we are corrupt, we don't want to attempt to create any points
            //      // whatsoever.
            //      if (destinationHandler.isCorrupt())
            //      {
            //        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            //          SibTr.debug(tc, "createDestinationLocalization",
            //            "Point " + destinationLocalizationDefinition.getIdentifier()
            //            + " not created since destination " + destinationHandler.getName()
            //            + " is corrupt.");
            //
            //        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            //          SibTr.exit(tc, "createDestinationLocalization");
            //
            //        return;
            //      }

            //If we didnt just create the destinationHandler, it is valid for this
            //create call to be made at startup or to create a local queue point
            if (!destinationHandlerCreated)
            {
                //---199538--------------------------------------------------------------
                //This USED to test whether the destination was reconciling
                //and, if not, would throw an exception. This is no longer the case, as
                //dynamic updates might cause this method to be called for a destination
                //that already exists i.e. when localising a qPt on a previously
                //remote destination.
                //-----------------------------------------------------------------------

                if (destinationHandler.isReconciled() && (destinationHandler.hasLocal() || destinationLocalizationDefinition == null))
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(
                                   tc,
                                   "createDestinationLocalization",
                                   nls_cwsik.getFormattedMessage(
                                                                 "DELIVERY_ERROR_SIRC_31", // DESTINATION_ALREADY_EXISTS_ERROR_CWSIP0045
                                                                 new Object[] { destinationDefinition.getName() },
                                                                 null));

                    SIMPDestinationAlreadyExistsException e = new SIMPDestinationAlreadyExistsException(
                                    nls_cwsik.getFormattedMessage(
                                                                  "DELIVERY_ERROR_SIRC_31", // DESTINATION_ALREADY_EXISTS_ERROR_CWSIP0045
                                                                  new Object[] { destinationDefinition.getName() },
                                                                  null));

                    e.setExceptionReason(SIRCConstants.SIRC0031_DESTINATION_ALREADY_EXISTS_ERROR);
                    e.setExceptionInserts(new String[] { destinationDefinition.getName() });
                    throw e;
                }

                // Only update destination handler objects with WCCM information if
                // we have not already detected them as corrupt.
                if (!destinationHandler.isCorruptOrIndoubt())
                {
                    // Destination already exists.  In the new WCCM world, the
                    // create should complete succesfully, with the new destination
                    // definition replacing the existing one.
                    // We update the localization definitions before we update the
                    // actual destination definition.

                    if (isQueue(destinationHandler.getDestinationType()))
                    {
                        if (destinationLocalizationDefinition != null)
                        {
                            // Update the localisation definition too.
                            destinationHandler.updateLocalizationDefinition(destinationLocalizationDefinition, transaction);
                        }
                    } // eof is q
                    else if (destinationHandler.getDestinationType() == DestinationType.TOPICSPACE)
                    {
                        destinationHandler.updateLocalizationDefinition(destinationLocalizationDefinition, transaction);
                    } // eof is topicspace

                    destinationHandler.updateDefinition(destinationDefinition);

                    // Update the set of localising messaging engines for the destinationHandler
                    // Dont create remote localisations up front.  This can be done
                    // if WLM picks one of them
                    destinationHandler.updateLocalizationSet(
                                    destinationLocalizingMEs);

                    // Alert the lookups object to handle the re-definition
                    DestinationIndex.Type type = new DestinationIndex.Type();
                    type.alias = new Boolean(destinationHandler.isAlias());
                    type.foreignDestination = new Boolean(destinationHandler.isForeign());
                    type.local = new Boolean(destinationHandler.hasLocal());
                    type.queue = new Boolean(!destinationHandler.isPubSub());
                    type.remote = new Boolean(destinationHandler.hasRemote());
                    type.state = destinationIndex.getState(destinationHandler);
                    destinationIndex.setType(destinationHandler, type);
                    destinationIndex.create(destinationHandler);

                    //Show that the destination is now reconciled
                    destinationHandler.setReconciled();

                    if (destinationHandler.getHasReconciledStreamsToBeDeleted())
                    {
                        //defect 259817
                        //there was some unfinished cleanup from before the ME previously shutdown
                        //that we now need to take care of.
                        destinationIndex.cleanup(destinationHandler);
                    }
                }
            }
            else // we did just create the destinationHandler.
            {
                if (isQueue(destinationHandler.getDestinationType()))
                {
                    if (destinationLocalizationDefinition != null)
                    {
                        // Create a new point to point localisation
                        destinationHandler.addNewPtoPLocalization(
                                                                  false,
                                                                  transaction,
                                                                  messagingEngineUuid,
                                                                  destinationLocalizationDefinition,
                                                                  true);
                    }
                } // eof is q
                else if (destinationHandler.getDestinationType() == DestinationType.TOPICSPACE)
                {
                    destinationHandler.addPubSubLocalisation(destinationLocalizationDefinition);
                } // eof is topicspace

                // Update the set of localising messaging engines for the destinationHandler
                // Dont create remote localisations up front.  This can be done
                // if WLM picks one of them
                destinationHandler.updateLocalizationSet(
                                destinationLocalizingMEs);

                // Put the newly created destination handler into the indexes
                destinationIndex.setLocalizationFlags(destinationHandler);

            } // eof we did just create the DH
        } // end of synchronization

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createDestinationLocalization");
    }
160008
private Transaction createTransaction(long writePointer, TransactionType type) {
    // For holding the first in progress short transaction Id (with timeout >= 0).
    long firstShortTx = Transaction.NO_TX_IN_PROGRESS;
    LongArrayList inProgressIds = new LongArrayList(inProgress.size());
    for (Map.Entry<Long, InProgressTx> entry : inProgress.entrySet()) {
      long txId = entry.getKey();
      inProgressIds.add(txId);
      // add any checkpointed write pointers to the in-progress list
      LongArrayList childIds = entry.getValue().getCheckpointWritePointers();
      if (childIds != null) {
        for (int i = 0; i < childIds.size(); i++) {
          inProgressIds.add(childIds.get(i));
        }
      }
      if (firstShortTx == Transaction.NO_TX_IN_PROGRESS && !entry.getValue().isLongRunning()) {
        firstShortTx = txId;
      }
    }

    return new Transaction(readPointer, writePointer, invalidArray, inProgressIds.toLongArray(), firstShortTx, type);
  }
987665
public int onePhaseCommitRemoteTransaction(GlobalTransaction gtx, List<WriteCommand> modifications) {
      RpcManager rpcManager = cache.getRpcManager();
      CommandsFactory factory = cache.getComponentRegistry().getCommandsFactory();
      try {
         //only pessimistic tx are committed in 1PC and it doesn't use versions.
         PrepareCommand command = factory.buildPrepareCommand(gtx, modifications, true);
         CompletionStage<Void> cs = rpcManager.invokeCommandOnAll(command, validOnly(), rpcManager.getSyncRpcOptions());
         factory.initializeReplicableCommand(command, false);
         command.invokeAsync().join();
         cs.toCompletableFuture().join();
         forgetTransaction(gtx, rpcManager, factory);
         return loggingCompleted(true) == Status.OK ?
                XAResource.XA_OK :
                XAException.XAER_RMERR;
      } catch (Throwable throwable) {
         //transaction should commit but we still can have exceptions (timeouts or similar)
         return XAException.XAER_RMERR;
      }
   }
532819
public CompletableFuture<UpdateStreamStatus.Status> sealStream(String scope, String stream, OperationContext contextOpt) {
        final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
        final long requestId = requestTracker.getRequestIdFor("sealStream", scope, stream);

        // 1. post event for seal.
        SealStreamEvent event = new SealStreamEvent(scope, stream, requestId);
        return addIndexAndSubmitTask(event, 
                // 2. set state to sealing
                () -> streamMetadataStore.getVersionedState(scope, stream, context, executor)
                .thenCompose(state -> {
                    if (state.getObject().equals(State.SEALED)) {
                        return CompletableFuture.completedFuture(state);
                    } else {
                        return streamMetadataStore.updateVersionedState(scope, stream, State.SEALING, state, context, executor);
                    }
                }))
                // 3. return with seal initiated.
                .thenCompose(result -> {
                    if (result.getObject().equals(State.SEALED) || result.getObject().equals(State.SEALING)) {
                        return checkDone(() -> isSealed(scope, stream, context))
                                .thenApply(x -> UpdateStreamStatus.Status.SUCCESS);
                    } else {
                        return CompletableFuture.completedFuture(UpdateStreamStatus.Status.FAILURE);
                    }
                })
                .exceptionally(ex -> {
                    log.warn(requestId, "Exception thrown in trying to notify sealed segments {}", ex.getMessage());
                    return handleUpdateStreamError(ex, requestId);
                });
    }
1289412
@Override
    public TransactionManager newTransactionManager(Environment env) {
        return new JtaTransactionManager(
            env.get(EnvironmentName.TRANSACTION),
            env.get(EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY),
            env.get(EnvironmentName.TRANSACTION_MANAGER ));
    }
742991
protected void invokeAuthenticationPostProcessors(final AuthenticationBuilder builder,
                                                      final AuthenticationTransaction transaction) {
        LOGGER.debug("Invoking authentication post processors for authentication transaction");
        val pops = authenticationEventExecutionPlan.getAuthenticationPostProcessors(transaction);

        final Collection<AuthenticationPostProcessor> supported = pops.stream().filter(processor -> transaction.getCredentials()
            .stream()
            .anyMatch(processor::supports))
            .collect(Collectors.toList());
        for (val p : supported) {
            p.process(builder, transaction);
        }
    }
838346
private Serializable doWorkInIsolationTransaction(final SharedSessionContractImplementor session)
			throws HibernateException {
		class Work extends AbstractReturningWork<IntegralDataTypeHolder> {
			private final SharedSessionContractImplementor localSession = session;

			@Override
			public IntegralDataTypeHolder execute(Connection connection) throws SQLException {
				try {
					return doWorkInCurrentTransactionIfAny( localSession );
				}
				catch ( RuntimeException sqle ) {
					throw new HibernateException( "Could not get or update next value", sqle );
				}
			}
		}
		//we want to work out of transaction
		boolean workInTransaction = false;
		Work work = new Work();
		Serializable generatedValue = session.getTransactionCoordinator().createIsolationDelegate().delegateWork( work, workInTransaction );
		return generatedValue;
	}
68540
public PtoPMessageItemStream addNewRemotePtoPLocalization(
    TransactionCommon transaction,
    SIBUuid8 messagingEngineUuid,
    LocalizationDefinition destinationLocalizationDefinition,
    boolean queuePoint,
    AbstractRemoteSupport remoteSupport) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "addNewRemotePtoPLocalization",
        new Object[] {
          transaction,
          messagingEngineUuid,
          destinationLocalizationDefinition,
          Boolean.valueOf(queuePoint),
          remoteSupport });

    PtoPMessageItemStream newMsgItemStream = null;

    // Add to the MessageStore
    try
    {

        if (queuePoint)
        {
          newMsgItemStream =
            new PtoPXmitMsgsItemStream(_baseDestinationHandler, messagingEngineUuid);
        }

      transaction.registerCallback(
        new LocalizationAddTransactionCallback(newMsgItemStream));

      Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);
      _baseDestinationHandler.addItemStream(newMsgItemStream, msTran);

      // Set the default limits
      newMsgItemStream.setDefaultDestLimits();
      // Setup any message depth interval checking (510343)
      newMsgItemStream.setDestMsgInterval();

      attachRemotePtoPLocalisation(newMsgItemStream, remoteSupport);
    }
    catch (OutOfCacheSpace e)
    {
      // No FFDC code needed

      SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "addNewRemotePtoPLocalization", "SIResourceException");

      throw new SIResourceException(e);
    }
    catch (MessageStoreException e)
    {
      // MessageStoreException shouldn't occur so FFDC.
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.destination.LocalisationManager.addNewRemotePtoPLocalization",
        "1:1562:1.30",
        this);

      SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "addNewRemotePtoPLocalization", e);

      throw new SIResourceException(e);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addNewRemotePtoPLocalization", newMsgItemStream);

    return newMsgItemStream;
  }