Forum Stats

  • 3,758,212 Users
  • 2,251,354 Discussions
  • 7,870,111 Comments

Discussions

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

Moh
Moh Member Posts: 131 Silver Badge
edited Sep 5, 2012 3:00PM in Java Message Service (JMS)
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
Tagged:

Answers

This discussion has been closed.