So here's my configuration (though there's not much to it):

In addition to the T5 and tapestry-jpa dependencies in my pom, I also have
these:


        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>eclipselink</artifactId>
            <version>2.2.1</version>
        </dependency>

I haven't changed my persistence.xml from when it was working fine with
tynamo (other than as I mentioned, needing to change the name of my
datasrouce for some reason).  Located on my classpath in
src/main/resources/META-INF:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"; version="1.0">
    <persistence-unit name="stellaPeristenceUnit" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/mypool</jta-data-source>
        <class>com.mydomain.app.entity.OneOfMyEntities</class>
        <class>com.mydomain.app.entity.AnotherOneOfMyEntities</class>
        <properties>
            <property name="eclipselink.target-database" value="MySQL" />
            <property name="eclipselink.cache.shared.default"
value="${tapestry.production-mode}"/>
        </properties>
    </persistence-unit>
</persistence>

Then:

I changed all of my import statements to use @CommitAfter from tapestry-jpa
instead of tynamo (note that I have of course removed the dependency for
tynamo from my pom)

And I add transaction advice in my AppModule like so:

    @Match({"*DAO", "*DAOImpl"})
    public static void adviseTransactionally(JpaTransactionAdvisor advisor,
MethodAdviceReceiver receiver) {
        advisor.addTransactionCommitAdvice(receiver);
    }

What else is there to it?  Am I missing something?  I'm not providing code
from my entities here, but I know that they are not the problem because as
I've already stated this project works great with tynamo's implementation of
tapestry-jpa and the same persistence.xml.  My entities are somewhat
complicated, use inheritance, and have lazy loaded one to many and many to
many relationships... but obviously this should all just work, no?

If it is indeed problems with my configuration, it would be great to get
some help.  If it is a bug in T5 I would love to hear that it will be looked
into because I would HATE to get left behind and stuck with 5.2.6!



--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Problems-using-JPA-with-5-3-tp6898469p6911216.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to