kongchai jaidee
kongchai jaidee

Reputation: 21

After upgrade Netbean to 7.3.1 that change Eclipselink to 2.5 I found this error

After I upgrade Netbeans to 7.3.1 that come with eclipeLink 2.5 and Glassfish4. When I ran by application I always got this error message

SEVERE: javax.persistence.TransactionRequiredException: Cannot call methods requiring a transaction if the entity manager has not been joined to the current transaction.

How can I fix this problem?

Upvotes: 0

Views: 404

Answers (1)

Chris
Chris

Reputation: 21145

JPA requires you to call em.joinTransaction() if a JTA transaction is started after the entityManager was obtained. Prior to EclipseLink 2.5, EclipseLink might automatically flush to the active transaction even if it wasn't joined to it as described in bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=404294

Upvotes: 1

Related Questions