fix for AMQ-689 to deal with NPE

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@408636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-05-22 10:39:32 +00:00
parent e0692dd265
commit 9d0ca025fa
1 changed files with 3 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import javax.resource.spi.work.WorkListener;
import javax.resource.spi.work.WorkManager;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.TransactionContext;
import org.apache.activemq.ActiveMQSession.DeliveryListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -215,7 +216,8 @@ public class ServerSessionImpl implements ServerSession, InboundContext, Work, D
} catch (Throwable e) {
throw new RuntimeException("Endpoint after delivery notification failure", e);
} finally {
if( session.getTransactionContext().isInLocalTransaction() ) {
TransactionContext transactionContext = session.getTransactionContext();
if( transactionContext != null && transactionContext.isInLocalTransaction() ) {
if( !useRAManagedTx ) {
// Sanitiy Check: If the local transaction has not been commited..
// Commit it now.