Atomikos Forum |
|
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)
Anyway, here it is: http://docs.google.com/Doc?id=dhcms9z2_7023g62mmz
|