Atomikos Forum

Jetty & Spring

Hi,

I integrated Atomikos in Jetty:

    <Call class="java.lang.System" name="setProperty">
        <Arg>com.atomikos.icatch.file</Arg>
        <Arg>src/test/conf/atomikos/jta.properties</Arg>
    </Call>

    <New id="tx" class="org.mortbay.jetty.plus.naming.Transaction">
        <Arg>
            <New class="com.atomikos.icatch.jta.UserTransactionImp" />
        </Arg>
    </New>

And I let Spring to lookup for a the Transaction Manager with the following statement:

    <tx:jta-transaction-manager/>

When I start the Spring application, I've got a warning message in the console:

2009-09-18 19:07:32,011 WARN [org.springframework.transaction.jta.JtaTransactionManager] - No JTA TransactionManager found: transaction suspension and synchronization with existing JTA transactions not available

So, what does the message imply? How can I resolve this issue? Should I refine the Jetty Configuration to expose the Transaction Manager?

I know that I can integrate Atomikos into Spring but I want the Spring app be  container independent. So, this workaround can't be applied in my case.

Any help would be appreciated,

Regards,
Alexandre Garino
Alexandre Garino Send private email
Friday, September 18, 2009
 
 
You could try with a JNDI lookup of the JTA transaction manager (by configuring Jetty JNDI) and then tell Spring to inject the JTA objects based on a JNDI lookup. That way, you only need the JTA interfaces in your Spring config, no concrete Atomikos classnames...

HTH
Guy Pardon Send private email
Friday, September 18, 2009
 
 
Hi Guy,

For now, the UserTransaction is registered with JNDI in Jetty.

In Spring I have no dependencies to Atomikos (see ma previous post). The UserTransaction is injected through the JtaTransactionManager of Spring.

The warning message is about transaction suspension. The spring doc says (http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/transaction/jta/JtaTransactionManager.html):

"Transaction suspension (REQUIRES_NEW, NOT_SUPPORTED) is just available with a JTA TransactionManager being registered"

As I've got some cases with REQUIRES_NEW transactions, so I need to expose the transaction manager through JNDI to enable Transaction suspension.

But the code below only register the UserTransaction, not the TransactionManager:

<New id="tx" class="org.mortbay.jetty.plus.naming.Transaction">
    <Arg>
        <New class="com.atomikos.icatch.jta.UserTransactionImp" />
    </Arg>
</New>

According to the doc above and the lookup strategy of the JtaTransactionManager I should register the transaction manager as "java:comp/TransactionManager".

A workaround is to extend or refactor the UserTransactionImp to bind the TransactionManager as well.

Or perhaps there is a way to bind the TransactionManager with some extra conf in Jetty. But I did not find sample in the doc doing this.

Regards,
Alexandre
Alexandre Garino Send private email
Tuesday, September 22, 2009
 
 
Hi,

At first thought I don't now the answer - but we can invest some time in this. Do you have access to a budget for developer support? We could investigate this for 1 ticket - can be purchased on http://www.atomikos.com/Main/AtomikosQuote.

Thanks
Guy Pardon Send private email
Tuesday, September 22, 2009
 
 

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

Other recent topics Other recent topics