This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Kodos + XA DataSource + Weblogic 10 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Kodos + XA DataSource + Weblogic 10" Watch "Kodos + XA DataSource + Weblogic 10" New topic
Author

Kodos + XA DataSource + Weblogic 10

Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
Hi,
I am trying to create an XA datasource on weblogic 10 and when i try to retrieve the records from the db, i get the below error. "Cannot Set Auto-Commit mode when using distributed transaction" Also below is my persistence.xml

Exception in thread "main" javax.ejb.EJBException: nested exception is: org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.0.2-r420667:627158 fatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot set auto-commit mode when using distributed transactions
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.0.2-r420667:627158 fatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot set auto-commit mode when using distributed transactions
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:379)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:261)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="persistence1" transaction-type="JTA">
<jta-data-source>persist-XA</jta-data-source>
<class>---</class>
<properties>
<property name="kodo.Connection2Username" value="val"/>
<property name="kodo.Connection2Password" value="val"/>
<property name="kodo.Connection2URL" value="jdbc racle:thin:@IP:1521 ev1"/>
<property name="kodo.Connection2DriverName" value="oracle.jdbc.xa.client.OracleXADataSource"/>
<property name="kodo.ConnectionFactory2Properties" value="MaxActive=20, MaxIdle=10"/>
<property name="kodo.TransactionMode" value="managed"/>
<property name="kodo.ConnectionFactoryMode" value="managed"/>
</properties>
</persistence-unit>
</persistence>

Please provide your inputs.

Regards,
Venkat Dasari


Regards,<br />Venkat Dasari<br />SCJP 1.4, SCBCD.
 
GeeCON Prague 2014
 
subject: Kodos + XA DataSource + Weblogic 10