Atomikos Forum

Transaction not committed

Hi,

I’ve started to use atomikos in combination with spring, but I have a strange problem with a simple scenario:

public class MainService {
    private NestedService nestedService;
    private TheDao theDao;

    @Transactional
    public void mainMethod(){
        theDao.insert(); //an insert into the db
        nestedService.nestedMethod(); //just force a new transaction
        theDao.count(); //a query
    }
}

public class NestedService {
    TheDao theDao;

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void nestedMethod(){
        //empty
    }
}

The datasource bean:

<bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean">
        <property name="uniqueResourceName" value="db1"/>
        <property name="xaDataSourceClassName" value="com.jnetdirect.jsql.JSQLXADataSource"/>
        <property name="minPoolSize" value="2"/>
        <property name="maxPoolSize" value="2"/>
        <property name="reapTimeout" value="0"/>
        <property name="xaProperties">
            <props>
                <prop key="user">*</prop>
                <prop key="password">*</prop>
                <prop key="url">jdbc:JSQLConnect://is-right/database=*</prop>
            </props>
        </property>
</bean>

When I call mainService.mainMethod(), the insert there is never committed into the database.
By looking at the logs, looks like there two connection used: one before the inner transaction and one after. The first one is never committed.

Am I doing something wrong?

(logs will follow)
Adrian Miron Send private email
Wednesday, July 23, 2008
 
 
…I cannot post the log; I’m getting an internal error: “FogBugz Internal Error
An internal error occurred in FogBugz….”
Adrian Miron Send private email
Wednesday, July 23, 2008
 
 
Adrian Miron Send private email
Wednesday, July 23, 2008
 
 
Hi,

In your logs I see two XA resource instances in the main method, but only one of them gets committed. What DB are you using?

Guy
Guy Pardon Send private email
Thursday, July 31, 2008
 
 
I’m using MSSQL Server 2005 with the JSQLConnect driver (www.jnetdirect.com).

Yes, only one of the XA resource gets committed, the one used after the outer transaction resumes.
Adrian Miron Send private email
Friday, August 01, 2008
 
 

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

Other recent topics Other recent topics