| [news.eclipse.rt.eclipselink] Re: Eclipselink JTA without jndi |
Thanks!
The exception is
org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: PersistenceUnitInfo PU has transactionType JTA, but
doesnt have jtaDataSource.
We are using JPA and are using spring's LocalContainerEntityManagerFactoryBean.
Here is an example that works with hibernate:
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaVendorAdapter">
<bean class="${jpa.adapter}">
<property name="databasePlatform"
value="${jpa.platform}" />
<property name="showSql" value="${jpa.showSql}" />
<property name="generateDdl" value="${jpa.generateDdl}" />
</bean>
</property>
<property name="persistenceXmlLocation"
value="classpath:META-INF/my-persistence.xml" />
<property name="dataSource" ref="myDataSource" />
<property name="jpaPropertyMap" ref="jpaConfig" />
</bean>
and here is a sample persistence xml:
<persistence version="1.0"
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">
<persistence-unit name="PU" transaction-type="JTA">
<class>com.foo.MyEntity</class>
</persistence-unit>
</persistence>
The spring integration works with eclipselink when using non jta transaction type. We are using a spring datasource and not jndi.
Gordon Yorke wrote:
Are you using JPA? If you are using the non JPA Spring integration then you should not have to do anything special. If you are using JPA then just set the XA datasource as your jta-datasource in the persistence.xml file.
Can you provide details on the exception that you saw. What are the details on your system's architecture and configuration.
--Gordon