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
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.
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.