Monkey-patch to disable XA in BPEL SE

noxa
Vitaliy Filippov 2015-12-21 22:23:51 +03:00
parent 49fdfb78d1
commit 724b5feaa9
3 changed files with 19 additions and 26 deletions

View File

@ -592,15 +592,15 @@ public class StateManagerImpl implements StateManager {
* where its set in the Registry * where its set in the Registry
*/ */
String stateId = state.getId(); String stateId = state.getId();
TransactionManager tm = (TransactionManager) BPELSERegistry.getInstance().lookup( // TransactionManager tm = (TransactionManager) BPELSERegistry.getInstance().lookup(
TransactionManager.class.getName()); // TransactionManager.class.getName());
if (StateManager.TransactionType.XAParticipate.equals(transactionInfo.getTransactionType())) { if (StateManager.TransactionType.XAParticipate.equals(transactionInfo.getTransactionType())) {
AbstractDBConnection xadbConnection = null; AbstractDBConnection xadbConnection = null;
try { try {
tm.resume(transactionInfo.getTransaction()); // tm.resume(transactionInfo.getTransaction());
transactionInfo.getTransaction().registerSynchronization( // transactionInfo.getTransaction().registerSynchronization(
transactionInfo.getSynchronization()); // transactionInfo.getSynchronization());
xadbConnection = mDBFactory.createXAConnection(); xadbConnection = mDBFactory.createXAConnection();
performDBOperationForDBOs(insertUpdateDeleteDBOs, xadbConnection); performDBOperationForDBOs(insertUpdateDeleteDBOs, xadbConnection);
@ -614,13 +614,13 @@ public class StateManagerImpl implements StateManager {
stateId, insertActIds, updateActIds, deleteActIds)); stateId, insertActIds, updateActIds, deleteActIds));
} }
tm.suspend(); // tm.suspend();
} catch (Exception pExcep) { } catch (Exception pExcep) {
printSQLBatchExceptions(pExcep); printSQLBatchExceptions(pExcep);
// Just in case the connection is stale, validate it. This will cause the connection to be removed // Just in case the connection is stale, validate it. This will cause the connection to be removed
// from the DataSource (sun impl of DataSource only) // from the DataSource (sun impl of DataSource only)
mDBFactory.validateXAConnection(xadbConnection); mDBFactory.validateXAConnection(xadbConnection);
transactionInfo.getTransaction().setRollbackOnly(); // transactionInfo.getTransaction().setRollbackOnly();
if (LOGGER.isLoggable(Level.FINEST)) { if (LOGGER.isLoggable(Level.FINEST)) {
String insertActIds = insertUpdateDeleteDBOs.getActIdForInserts(); String insertActIds = insertUpdateDeleteDBOs.getActIdForInserts();
String updateActIds = insertUpdateDeleteDBOs.getActIdForUpdates(); String updateActIds = insertUpdateDeleteDBOs.getActIdForUpdates();
@ -631,7 +631,7 @@ public class StateManagerImpl implements StateManager {
stateId, insertActIds, updateActIds, deleteActIds)); stateId, insertActIds, updateActIds, deleteActIds));
} }
tm.suspend(); // tm.suspend();
throw new RuntimeException( throw new RuntimeException(
I18n.loc("BPCOR-6076: Exception thrown while processing transaction type XAParticipate"), I18n.loc("BPCOR-6076: Exception thrown while processing transaction type XAParticipate"),
pExcep); pExcep);
@ -650,24 +650,24 @@ public class StateManagerImpl implements StateManager {
} }
} else if (StateManager.TransactionType.XAStartNew.equals(transactionInfo.getTransactionType())) { } else if (StateManager.TransactionType.XAStartNew.equals(transactionInfo.getTransactionType())) {
try { /* try {
tm.begin(); tm.begin();
transactionInfo.setTransaction(tm.getTransaction()); transactionInfo.setTransaction(tm.getTransaction());
tm.suspend(); tm.suspend();
} catch (Exception startExcep) { } catch (Exception startExcep) {
throw new RuntimeException(I18n.loc("BPCOR-6078: Exception thrown while processing " + throw new RuntimeException(I18n.loc("BPCOR-6078: Exception thrown while processing " +
"transaction type XAStartNew: {0}"), startExcep); "transaction type XAStartNew: {0}"), startExcep);
} }*/
} else if (StateManager.TransactionType.XAEnd.equals(transactionInfo.getTransactionType())) { } else if (StateManager.TransactionType.XAEnd.equals(transactionInfo.getTransactionType())) {
AbstractDBConnection xadbConnection = null; AbstractDBConnection xadbConnection = null;
boolean sucess = false; boolean sucess = false;
try { try {
tm.resume(transactionInfo.getTransaction()); // tm.resume(transactionInfo.getTransaction());
xadbConnection = mDBFactory.createXAConnection(); xadbConnection = mDBFactory.createXAConnection();
performDBOperationForDBOs(insertUpdateDeleteDBOs, xadbConnection); performDBOperationForDBOs(insertUpdateDeleteDBOs, xadbConnection);
transactionInfo.getTransaction().commit(); // transactionInfo.getTransaction().commit();
sucess = true; sucess = true;
if (LOGGER.isLoggable(Level.FINEST)) { if (LOGGER.isLoggable(Level.FINEST)) {
String insertActIds = insertUpdateDeleteDBOs.getActIdForInserts(); String insertActIds = insertUpdateDeleteDBOs.getActIdForInserts();
@ -685,7 +685,7 @@ public class StateManagerImpl implements StateManager {
boolean connOK = mDBFactory.validateXAConnection(xadbConnection); boolean connOK = mDBFactory.validateXAConnection(xadbConnection);
// Suspend the transaction and then throw the appropriate exception which would call the condition // Suspend the transaction and then throw the appropriate exception which would call the condition
// XACanel that will perform the rollback of the transaction. // XACanel that will perform the rollback of the transaction.
tm.suspend(); // tm.suspend();
if (LOGGER.isLoggable(Level.FINEST)) { if (LOGGER.isLoggable(Level.FINEST)) {
String insertActIds = insertUpdateDeleteDBOs.getActIdForInserts(); String insertActIds = insertUpdateDeleteDBOs.getActIdForInserts();
String updateActIds = insertUpdateDeleteDBOs.getActIdForUpdates(); String updateActIds = insertUpdateDeleteDBOs.getActIdForUpdates();
@ -728,8 +728,8 @@ public class StateManagerImpl implements StateManager {
} else if (StateManager.TransactionType.XACancel.equals(transactionInfo.getTransactionType())) { } else if (StateManager.TransactionType.XACancel.equals(transactionInfo.getTransactionType())) {
try { try {
tm.resume(transactionInfo.getTransaction()); // tm.resume(transactionInfo.getTransaction());
transactionInfo.getTransaction().rollback(); // transactionInfo.getTransaction().rollback();
if (LOGGER.isLoggable(Level.FINEST)) { if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.log(Level.FINEST, LOGGER.log(Level.FINEST,
I18n.loc("BPCOR-3045: TX type XACancel rolledback with stateid = {0}", stateId)); I18n.loc("BPCOR-3045: TX type XACancel rolledback with stateid = {0}", stateId));

View File

@ -101,7 +101,9 @@ public class TxPropagationObject {
* @return * @return
*/ */
public boolean extractTransactionFromRequest(MessageContainer request, BPELProcessManager processMgr) { public boolean extractTransactionFromRequest(MessageContainer request, BPELProcessManager processMgr) {
mRequest = request; mAtomicTxType = TransactionType.nosupport;
return false;
/* mRequest = request;
mTransaction = request.getTransaction(); mTransaction = request.getTransaction();
String atomicTxType = processMgr.getAtomicTxType(); String atomicTxType = processMgr.getAtomicTxType();
if (mTransaction == null && atomicTxType != null && atomicTxType.equals(TX_TYPE_REQUIRED)) { if (mTransaction == null && atomicTxType != null && atomicTxType.equals(TX_TYPE_REQUIRED)) {
@ -131,7 +133,7 @@ public class TxPropagationObject {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(I18n.loc("BPCOR-6105: Encountered an error while trying to register " throw new RuntimeException(I18n.loc("BPCOR-6105: Encountered an error while trying to register "
+ "synchronization object with the transaction to be propagated."), e); + "synchronization object with the transaction to be propagated."), e);
} }*/
} }
public Transaction getTransaction() { public Transaction getTransaction() {

View File

@ -294,9 +294,6 @@ BPCOR-6076 = Exception thrown while processing transaction type XAParticipate
# com.sun.jbi.engine.bpel.core.bpel.persist.impl.StateManagerImpl # com.sun.jbi.engine.bpel.core.bpel.persist.impl.StateManagerImpl
BPCOR-6077 = TX type XAParticipates, exception thrown when trying to close connection BPCOR-6077 = TX type XAParticipates, exception thrown when trying to close connection
# com.sun.jbi.engine.bpel.core.bpel.persist.impl.StateManagerImpl
BPCOR-6078 = Exception thrown while processing transaction type XAStartNew\: {0}
# com.sun.jbi.engine.bpel.core.bpel.persist.impl.StateManagerImpl # com.sun.jbi.engine.bpel.core.bpel.persist.impl.StateManagerImpl
BPCOR-6079 = Exception thrown while processing transaction type XAEnd BPCOR-6079 = Exception thrown while processing transaction type XAEnd
@ -379,9 +376,6 @@ BPCOR-6103 = Missmatched assign from message to non message. Process id {0}. Lin
# com.sun.jbi.engine.bpel.core.bpel.management.BPELSEManagement # com.sun.jbi.engine.bpel.core.bpel.management.BPELSEManagement
BPCOR-6104 = The bpelQName parameter as well as the searchString parameter are required to search for bpel instances by variable value. BPCOR-6104 = The bpelQName parameter as well as the searchString parameter are required to search for bpel instances by variable value.
# com.sun.jbi.engine.bpel.core.bpel.util.TxPropagationObject
BPCOR-6105 = Encountered an error while trying to register synchronization object with the transaction to be propagated.
# com.sun.jbi.engine.bpel.core.bpel.util.Utility # com.sun.jbi.engine.bpel.core.bpel.util.Utility
BPCOR-6106 = correlations with initiate value 'no' are not defined BPCOR-6106 = correlations with initiate value 'no' are not defined
@ -728,9 +722,6 @@ BPCOR-7134 = Invalid variable value \n{0}\nis assigned to {1} in BP instance ({2
# com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.ValidateUnitImpl # com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.ValidateUnitImpl
BPCOR-7135 = Invalid variable value \n{0}\nis in {1} in BP instance ({2}) at line {3} BP {4}. Error Summary\: {5} BPCOR-7135 = Invalid variable value \n{0}\nis in {1} in BP instance ({2}) at line {3} BP {4}. Error Summary\: {5}
# com.sun.jbi.engine.bpel.core.bpel.util.TxPropagationObject
BPCOR-7136 = Atomic mode, encountered an error while trying to begin and associate a transaction.
# com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.IMAScopeBridge # com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.IMAScopeBridge
BPCOR-7137 = Atomic mode, encountered an error while trying to commit a Transaction that was started by the bpel-se. BPCOR-7137 = Atomic mode, encountered an error while trying to commit a Transaction that was started by the bpel-se.