Atomikos Forum

[Spring] - Context Shutdown problem with TM already closed

Hi,

using Spring starting and working is fine - but destroying the context does result in:


2010-03-23 11:37:30,138 [Thread-12]      WARN  atomikos [Slf4jConsole.java:82] - MessageConsumerSession: Error ending thread tx association
javax.transaction.SystemException: This UserTransactionManager instance was closed already. Call init() to reuse if desired.
    at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:51)
    at com.atomikos.icatch.jta.UserTransactionManager.rollback(UserTransactionManager.java:187)
    at com.atomikos.jms.extra.MessageConsumerSession$ReceiverThread.run(MessageConsumerSession.java:524)
2010-03-23 11:37:30,138 [Thread-12]      WARN  atomikos [Slf4jConsole.java:82] - MessageConsumerSession: Error suspending transaction
javax.transaction.SystemException: This UserTransactionManager instance was closed already. Call init() to reuse if desired.
    at com.atomikos.icatch.jta.UserTransactionManager.checkSetup(UserTransactionManager.java:51)
    at com.atomikos.icatch.jta.UserTransactionManager.suspend(UserTransactionManager.java:218)
    at com.atomikos.jms.extra.MessageConsumerSession$ReceiverThread.run(MessageConsumerSession.java:562)


My MessageDrivenContainers still got depends-on dependecys to the TxServiceBean and the TM Bean.
I've got 3 MessageDriverContainer and calling stop on them via destroy-method configuraton at context shutdown time.

Stop does this:

    public void stopListening() {
    
        if ( current != null ) current.close ( true );
        current = null;
        tm.close();
        active = false;
    }

It does call tm.close():

    public void close()
    {
            if ( uts != null ) {
                uts.shutdown ( forceShutdown );
                uts = null;
            }
            closed = true;
    }

It does set the closed flag to true - but i've got 2 more containers which still got the ReceiverThread Thread running which still uses the TM which fails now with this exception, because stop is not yet called on them.

What should i do about it to get this working without exception and ensure correct shutdown order?
Torsten Krah Send private email
Tuesday, March 23, 2010
 
 
Good point, homework for us I guess.

Case created.

Thanks
Guy Pardon Send private email
Wednesday, March 24, 2010
 
 

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

Other recent topics Other recent topics