-
1. Re: javax.transaction.RollbackException
wolfgangknauf Feb 11, 2009 9:01 AM (in response to mravikrish)Hi Ramu,
which line causes the error? I assume it is "Project project = manager.merge(deleteProject);"?
This one is problematic, because you first load the project, then get the BuyerRating and VendorRating collections, and after this delete the relationships by executing a delete query. This will keep the collections in memory in your loaded project, but they don't exist in the database.
My suggestion is to change your code this way:
-First delete BuyerRating and VendorRating
-After this load the project by "Project deleteProject = manager.find(Project.class, projectId); "
Currently, you do it the other way round.
Hope this helps
Wolfgang -
2. Re: javax.transaction.RollbackException
mravikrish Feb 18, 2009 6:07 AM (in response to mravikrish)Hi Wolfgang,
I have tried exactly what u have said. but stll i am getting same exception. For time being i used two methods.
In First method i am removing all its associated entties like buyerrating,vendorrating,skills,bids.
In second method simply removing project object.
But this approch pushing me to go database twice.
i want to prform this in a single method.
Any suggessions
Thanks
K.Ramu -
3. Re: javax.transaction.RollbackException
wolfgangknauf Feb 18, 2009 6:18 AM (in response to mravikrish)Hi Ramu,
please post your modified code (and encapsulate it in "code" tags, see the toolbar in editor for the "Post reply" button).
Also provide us with the exception and the line number in your own code.
Best regards
Wolfgang