Atomikos Forum

ActiveMQXASession are not garbage collected

Hi,

I have a program that use a single JMS connection (only closed when my program exit) to get message from a JMS queue (using receive method). My program creates a transaction and a session each time it tries to consume new message.

After some time my program crash with an out of memory exception...

- With atomikos 3.2.3:

I found that there is always 2 sessions opened each time I call:
connection.createSession(false, Session.AUTO_ACKNOWLEDGE)

One of the session is created by com.atomikos.jms.DefaultJtaConnection:
protected static void forceConnectionIntoXaMode ( Connection c )
    {
      //ORACLE AQ WORKAROUND:
       //force connection into global tx mode
       //cf ISSUE 10095
       try {
           Session s = c.createSession ( true , Session.AUTO_ACKNOWLEDGE );
           s.rollback();
           s.close();
       }
       catch ( Exception e ) {
           //ignore: workaround code
           Configuration.logDebug ( "JMS: error forcing connection into global tx mode" , e );
       }
    }

The session created is an ActiveMQXASession and calling rollback on it throw an exception... Thus the session.close method is never called and cause a memory leak.


- Also I tried to use atomikos 3.4.0:
My session are referenced in com.atomikos.jms.AtomikosJmsConnectionProxy and never garbage collected...

- Also another question... Why the old QueueConnectionFactoryBean class is part of the transactions-essentials-all.jar in the distribution of 3.4.0 but is not include in the source directory? If I rebuild distribution version 3.4.0 I don't get the same jars as the one included in the original distribution...

(I use ActiveMQ 5.1.0 and Java 1.6)
Mathieu Baril Send private email
Tuesday, October 14, 2008
 
 
Hi,

Thanks for the feedback. I created issues accordingly.

Guy
Guy Pardon Send private email
Friday, October 17, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics