This discussion is archived
1 Reply Latest reply: Sep 5, 2012 12:00 PM by jtahlborn RSS

JMS Transaction and differnt behavior of Autocommit (Java, WebLogic)

Moh Pro
Currently Being Moderated
Hi all,

Behavior of Autocommit for JMS Tranasactions is different. JMS Modules are in webLogic Server and in Backend is Oracle DB (RAC) available.

A- autocommit is active (e.g. from Java code)

private static final String QUEUE_CONNECTION_FACTORY_JNDI_NAME = "java:comp/env/jms/defaultQueueConnectionFactory";
private static final String QUEUE_JNDI_NAME = "java:comp/env/jms/defaultQueue";
final QueueConnectionFactory connectionFactory = (QueueConnectionFactory) jndiContext.lookup(QUEUE_CONNECTION_FACTORY_JNDI_NAME);
final Queue destination = (Queue) jndiContext.lookup(QUEUE_JNDI_NAME);

B- autocommit is NOT active (e.g. from Java code)

private static final String QUEUE_CONNECTION_FACTORY_JNDI_NAME = "jms/QueueConnectionFactories/MYQUEUECF";
private static final String QUEUE_JNDI_NAME = "jms/Queues/MYQUEUE";
(That means "java:comp/env" is not defined...)

C- Now, autocommit is active again (e.g. from Java code)


@Resource(name = JNDINames.MYQUEUE_CONNECTIONFACTORY_NAME, mappedName = JNDINames.MYQUEUE_CONNECTIONFACTORY_JNDI_NAME)
private QueueConnectionFactory connectionFactory;

@Resource(name = JNDINames.MYQUEUE_NAME, mappedName = JNDINames.MYQUEUE_NAME)
private Queue destination;

public static final String MYQUEUE_CONNECTIONFACTORY_JNDI_NAME = "jms/QueueConnectionFactories/MYQUEUECF";
public static final String MYQUEUE_CONNECTIONFACTORY_NAME = "jms/defaultQueueConnectionFactory";
public static final String MYQUEUE_JNDI_NAME = "jms/Queues/MYQUEUE";
public static final String MYQUEUE_NAME = "jms/defaultQueue";

Can some body explain me, why the statements have different behavior?

Regards,
Moh

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points