surinder-insonix / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

Nested exceptions fail to commit on outer level #231

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I am using JPA with GAE. have a transaction and within that transaction I call 
a method a number of times to look something up and this method uses its own 
EntityManager and Transaction. When I try to commit the outer transaction I get 
an error. I check the transaction before committing and it says it is active. 
This sounds similar to issue 209 - however this has been open a long time.

The error message is: Operation commit failed on resource: 
org.datanucleus.store.appengine.DatastoreXAResource@71f435dd, error code 
UNKNOWN and transaction: [DataNucleus Transaction, ID=Xid=[**] , enlisted 
resources=[org.datanucleus.store.appengine.DatastoreXAResource@71f435dd]]
javax.persistence.RollbackException: Transaction failed to commit
    at org.datanucleus.jpa.EntityTransactionImpl.commit(EntityTransactionImpl.java:118)
    at org.datanucleus.store.appengine.jpa.DatastoreEntityTransactionImpl.commit(DatastoreEntityTransactionImpl.java:55)
    at uk.org.harwellcroquet.server.ItemServiceImpl.getHomeHtml(ItemServiceImpl.java:117)

where the [**] denotes some unprintable characters shown as squares by eclipse.

What version of the product are you using? On what operating system?
datanucleus-appengine-1.0.8.final.jar
datanucleus-core-1.1.5.jar
datanucleus-jpa-1.1.5.jar

with jdk 1.6 on Windows 7 running with Helios Eclipse

Original issue reported on code.google.com by dr.s.m.f...@gmail.com on 3 May 2011 at 10:27

GoogleCodeExporter commented 8 years ago
Please note that the subject is wrong. It should say nested transactions rather 
than nested exceptions. Sorry.

Original comment by dr.s.m.f...@gmail.com on 3 May 2011 at 10:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
JPA doesn't support nested transactions; you're not using them anyway. You say 
you're using one EM, and then nesting calls to a separate EM within that. But 
the transactions aren't linked. Define your persistence classes, and 
persistence code ... i.e a reproducible testcase

Original comment by googleco...@yahoo.co.uk on 26 Jun 2011 at 6:01

GoogleCodeExporter commented 8 years ago
Suggest you look at issue 174, since that is likely what you're talking about. 
But then the requirement to produce a testcase to demonstrate this is still 
required

Original comment by googleco...@yahoo.co.uk on 15 Jul 2011 at 3:27