Merged openesb/openesb-components into master

master
simon steinmetz 2013-07-04 12:26:06 +02:00
commit e9ab086ae5
3 changed files with 15 additions and 9 deletions

View File

@ -56,9 +56,9 @@
</goals>
<configuration>
<tasks>
<patternset id="jbicomps.junit.test.patternset" >
<patternset id="jbicomps.junit.test.patternset" >
<exclude name="**/framework/*.java"/>
<!--<exclude name="**/integrationtest/*.java"/>-->
<exclude name="**/integrationtest/*.java"/>
<exclude name="**/test/jbi/integration/**/*.java"/>
<include name="**/*Test*.java"/>
</patternset>

View File

@ -1060,6 +1060,7 @@ public class OutboundMessageProcessor {
Transaction transaction = (Transaction) outboundExchange.getProperty(
MessageExchange.JTA_TRANSACTION_PROPERTY_NAME);
boolean txResumed = false;
boolean shouldSuspendTx = false;
if (transaction != null) {
if (mLog.isLoggable(Level.FINE)) {
mLog.log(Level.FINE, "Got transaction context from message exchange " + outboundExchange.getExchangeId() + ". About to resume transaction before the Dispatch call...");
@ -1218,6 +1219,7 @@ public class OutboundMessageProcessor {
}
}
}
shouldSuspendTx = true;
dispatch.invokeOneWay(soapMsg);
} else {
if (mMonitorEnabled) {
@ -1234,6 +1236,7 @@ public class OutboundMessageProcessor {
ctx.setProbe(callDispatchMeasurement);
AsyncResponseHandler<SOAPMessage> handler = AsyncResponseDispatcher.instance().getHandler(ctx);
dispatch.invokeAsync(soapMsg, handler);
shouldSuspendTx = true;
/*if (mMonitorEnabled) {
try {
LoggingMonitoringUtil.setCheckpoint(endpointMeta, trackingId, "Received-response-from-inout-remote-service", replySoapMsg.getSOAPPart().getEnvelope());
@ -1259,12 +1262,12 @@ public class OutboundMessageProcessor {
if (dispatch != null)
endpointMeta.releaseDispatch(dispatch);
if (txResumed) {
if (txResumed && shouldSuspendTx) {
if (mLog.isLoggable(Level.FINE)) {
mLog.log(Level.FINE, "Transction was resumed before the Dispatch call. Successfully received a SOAP response. " +
"About to suspend the transaction before sending the reply in the message exchange...");
}
//TransactionsUtil.suspendTransaction();
TransactionsUtil.suspendTransaction();
}
}
}

View File

@ -96,15 +96,17 @@ public class AsyncResponseProcessor<T> implements Runnable {
context.getEndpoint().getEndpointStatus().incrementReceivedReplies();
replyHTTP((DataSource) result);
} else {
final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1001");
logger.warning(err);
//final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1001");
suspendTransaction();
logger.warning("HTTPBC-E1001: Unsupported response media");
return;
}
try {
suspendTransaction();
context.getChannel().send(context.getInout());
} catch (MessagingException ex) {
final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1002");
logger.warning(err);
//final String err = Messages.getMessages(AsyncResponseProcessor.class).getString("HTTPBC-E1002");
logger.warning(new StringBuilder("HTTPBC-E1002: ").append(ex.getMessage()).toString());
}
} finally {
@ -272,7 +274,7 @@ public class AsyncResponseProcessor<T> implements Runnable {
private void resumeTransaction() {
javax.transaction.Transaction tx = (Transaction) context.getInout().getProperty(context.getInout().JTA_TRANSACTION_PROPERTY_NAME);
if (tx != null) {
TransactionsUtil.resumeTransaction(tx);
txResumed = TransactionsUtil.resumeTransaction(tx);
}
}
@ -280,6 +282,7 @@ public class AsyncResponseProcessor<T> implements Runnable {
try {
if (txResumed) {
TransactionsUtil.suspendTransaction();
txResumed = false;
}
} catch (SystemException ex) {/* I hope noone uses misterious XA*/