problem in obtaining multiple connection in a single transac
palash.you Nov 12, 2009 2:38 AMHi All,
We are stuck in an issue, probably related to distributed transaction related JBOSS server configuration. We are working on the migration activity of the existing application. Below are the details
1. We are using EJB3.0 and nature of transaction is distributed
2. We are using more than one databases in one transaction
3. MySQL version: MySQL community 5.0.45
4. Application Server: JBoss 4.2.3 GA
4. MySQL storage Engine: INNODB
5. MySQL Driver: mysql-connector-java-5.0.8-bin.jar
Since we are using distributed transactions , we have defined
xa-datasources "mysql-xa-ds.xml" like below.
<xa-datasource> <jndi-name>jdbc/ABC</jndi-name> <use-java-context>false</use-java-context> <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> <xa-datasource-property name="URL">jdbc:mysql://*.*.*.*:3306/npd_fw_common</xa-datasource-property> <xa-datasource-property name="User">XXXXX</xa-datasource-property> <xa-datasource-property name="Password">XXXXX</xa-datasource-property> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <prepared-statement-cache-size>32</prepared-statement-cache-size> <metadata> <type-mapping>mySQL</type-mapping> </metadata> <!--the minimum size of the connection pooL--> <min-pool-size>10</min-pool-size> <!--The maximum connections in a pool/sub-pool--> <max-pool-size>50</max-pool-size> </xa-datasource>
Problem Scenario:
1. Starts a transaction which connects to a database and fires an insert query: Successful
2. In the same transaction try to connect one more database: Gets following error:
Error
2009-11-11 10:58:12,515 ERROR com.nucleus.finnonenext.framework.core.dbmanager.dao.CoreConnectionManager.getConnection(CoreConnectionManager.java:129) %m org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a013351:e045:4afa4a3b:4f status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: a013351:e045:4afa4a3b:4f status: ActionStatus.ABORT_ONLY >)
After this whole transaction gets rolled back.
Would like to to know the approprite server configuration steps which can be used for distributed transaction .
Would appriciate your help to resolve this issue
regards,
Palash