• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Kodos + XA DataSource + Weblogic 10

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
We don't have time to be charming! Quick, read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic