javax.jms.TransactionInProgressException:

Hi

I'm getting an exception like following...

[19/Jun/2004:07:36:17] WARNING (25649): CORE3283: stderr: javax.jms.TransactionInProgressException: tx in progress

[19/Jun/2004:07:36:17] WARNING (25649): CORE3283: stderr:at com.sun.enterprise.jms.SessionWrapperEjb.commit(SessionWrapperEjb.java:50)

Any Idea?

Thanks in Advance

[392 byte] By [vcbiju] at [2007-11-25 17:19:11]
# 1

A transactionInProgress message is usually seen when you

try to commit or rollback a still open connection (as part of

2 phase comment)

I would need to know:

1. version of app server/message queue

2. full stack trace

3. a description of what the code is doing

to know specifically what the app server doesnt like about the

transaction.

Since the exception is being sent from the app server code, you

may want to also post on the app server forumn

lk_schneider at 2007-7-3 12:47:30 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 2

We are using SunOne 7 ,Message Queue 3.5

The detailed stack trace is show below

javax.jms.TransactionInProgressException: tx in progress

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.enterprise.jms.SessionWrapperEjb.commit(SessionWrapperEjb.java:50)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.util.QueueHandler.pushMessage(QueueHandler.java:362)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.util.QueueHandler.pushMessageForSending(QueueHandler.ja va:102)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.component.util.cig.CIGAdminUtil.put(CIGAdminUtil.java:4 79)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.component.util.cig.CIGAdminUtil.createGroup(CIGAdminUti l.java:221)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.handler.cig.GroupRegistrationHandler.processRequest(Gro upRegistrationHandler.java:223)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.handler.cig.GroupRegistrationHandler.handle(GroupRegist rationHandler.java:126)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.handler.cig.CIGHandler.handle(CIGHandler.java:29)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.transversalnet.grid.ejb.processor.ProcessorBean.onMessage(ProcessorBean.jav a:83)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.ejb.containers.MessageBeanContainer.onMessage(MessageBeanContainer.java :857)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.ejb.containers.MessageBeanListenerConcurrent.onMessage(MessageBeanListe nerConcurrent.java:20)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.messaging.jmq.jmsclient.ServerSessionRunner.onMessage(ServerSessionRunn er.java:139)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.messaging.jmq.jmsclient.ServerSessionRunner.run(ServerSessionRunner.jav a:105)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.messaging.jmq.jmsclient.SessionImpl.run(SessionImpl.java:2313)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.sun.enterprise.jms.SessionWrapperBase.run(SessionWrapperBase.java:199)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at com.iplanet.ias.ejb.containers.IASServerSessionImpl.run(IASServerSessionImpl.ja va:191)

[20/Jun/2004:04:59:52] WARNING ( 2365): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)

The code is basically for sending the object message to the queue Shown below the code fragment

if(message != null)

{

queueSender.send(objectMessage,DeliveryMode.PERSISTENT,4,0);

}

else

{

System.out.println("WWWWWWWWWWW"+objectMessage);

queueSender.send(objectMessage,DeliveryMode.NON_PERSISTENT,4,2000);

//queueSender.send(objectMessage,DeliveryMode.PERSISTENT,4,0);

}

queueSession.commit();

} catch (Exception e)

{

e.printStackTrace ();

if(queue != null)

Logger.logError(e,"Error sending object to "+queueName);

else

Logger.logError(e,"Queue is null. Error sending object to Queue");

return false;

}

finally

{

try

{

if(queueConnection != null)

queueConnection.close();

} catch (Exception e)

{

e.printStackTrace();

}

}

suneeshvr at 2007-7-3 12:47:30 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 3

Look like the EJB has already started a transaction and the session.commit gets executed inside a transaction boundary of the EJB.

We'll suggest you to either not use transaction capability of J2EE or don't do session.commit.

Try it out and let us know.

thanks

Vibhor

Vibhor_Sharma at 2007-7-3 12:47:30 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 4

While packing the ejb in the ejb_jar.xml file i had specifiedtransaction-type as Container. When I changed to It to Bean, TransactionInProgressException is not coming.

Now when I commit the session It throws an IllegalStateException I read that this exception will come if you try to commit a non-transacted session. But I have created the session as transacted session like,

queueSession = queueConnection.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);

queueSender = queueSession.createSender(queue);

But queueSession.getTransacted() method returns false. and I cannot invoke commit();

Could you help? Or is there any problem if I did not commit the session ?

Thanks and Regards

Biju

vcbiju at 2007-7-3 12:47:30 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...
# 5

I assume that you are doing this in an ejb.

Could you please send us the exact piece of code and the deployment descriptor that you are using.

Have you used any kind of transaction apis in your code to start or stop the transaction apart from the JMS one's?

thanks

Vibhor

Vibhor_Sharma at 2007-7-3 12:47:30 > top of Java-index,Application & Integration Servers,Sun Java System Message Queue...