List of usage examples for javax.transaction.xa XAResource TMSUSPEND
int TMSUSPEND
To view the source code for javax.transaction.xa XAResource TMSUSPEND.
Click Source Link
From source file:it.doqui.index.ecmengine.business.personalization.multirepository.index.lucene.RepositoryAwareAbstractLuceneIndexerAndSearcherFactory.java
public void end(Xid xid, int flag) throws XAException { Map<String, LuceneIndexer> indexers = activeIndexersInGlobalTx.get(xid); if (indexers == null) { if (suspendedIndexersInGlobalTx.containsKey(xid)) { throw new XAException("Trying to commit indexes for a suspended transaction."); } else {//from w w w. j av a 2 s . c om // nothing to do return; } } if (flag == XAResource.TMSUSPEND) { activeIndexersInGlobalTx.remove(xid); suspendedIndexersInGlobalTx.put(xid, indexers); } else if (flag == TMFAIL) { activeIndexersInGlobalTx.remove(xid); suspendedIndexersInGlobalTx.remove(xid); } else if (flag == TMSUCCESS) { activeIndexersInGlobalTx.remove(xid); } }
From source file:org.alfresco.repo.search.impl.lucene.AbstractLuceneIndexerAndSearcherFactory.java
public void end(Xid xid, int flag) throws XAException { Map<StoreRef, LuceneIndexer> indexers = activeIndexersInGlobalTx.get(xid); if (indexers == null) { if (suspendedIndexersInGlobalTx.containsKey(xid)) { throw new XAException("Trying to commit indexes for a suspended transaction."); } else {/*from w w w. ja va 2 s . c o m*/ // nothing to do return; } } if (flag == XAResource.TMSUSPEND) { activeIndexersInGlobalTx.remove(xid); suspendedIndexersInGlobalTx.put(xid, indexers); } else if (flag == TMFAIL) { activeIndexersInGlobalTx.remove(xid); suspendedIndexersInGlobalTx.remove(xid); } else if (flag == TMSUCCESS) { activeIndexersInGlobalTx.remove(xid); } }
From source file:org.wso2.andes.client.XASession_9_1.java
/** * Send endDtx command to server/* www . j av a 2s .c o m*/ * * @param xid a global transaction identifier to be associated with the resource * @param flag one of TMSUCCESS, TMFAIL, or TMSUSPEND. * @return XaStatus returned by server * @throws FailoverException when a connection issue is detected * @throws AMQException when an error is detected in AMQ state manager */ XaStatus endDtx(Xid xid, int flag) throws FailoverException, AMQException, XAException { throwErrorIfClosed(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Sending dtx.end for channel " + _channelId + ", xid " + xid); } DtxEndBody dtxEndBody = methodRegistry.createDtxEndBody(xid.getFormatId(), xid.getGlobalTransactionId(), xid.getBranchQualifier(), flag == XAResource.TMFAIL, flag == XAResource.TMSUSPEND); AMQMethodEvent amqMethodEvent = _connection._protocolHandler.syncWrite(dtxEndBody.generateFrame(_channelId), DtxEndOkBody.class); DtxEndOkBodyImpl response = (DtxEndOkBodyImpl) amqMethodEvent.getMethod(); return XaStatus.valueOf(response.getXaResult()); }