I am getting the following error:
org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations):
and am not sure how it is happening...
What I am doing is this:
basically I am doing 3 things - adding some objects to the dataObject, deleting some services that are related to the dataObject and finally making couple of changes. the code is separate enough that there are 3 pieces instead of one huge piece. Basically it is a page with checkboxes. What I find to be the problem is this:
Scenario 1:
I run add, then delete service then make some updates - i get this cascade error when i am trying to remove all objects.
Scenario 2:
I run add, then update then delete - i get another error that it is expecting row count 1 when i really should have 0.
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
Scenario 3:
if i remove the update part of the code everything works fine - i am not sure why that part of the code
Note that these errors ONLY show up if i were to remove every "service" under dataObject. You can think dataObject as a form with 4 checkboxes and I am basically unchecking/checking them and then "save". If I check 2 and uncheck the other 2 everything's fine. If I uncheck them all then i get the errors. The service update is another check box for something else but under same dataObject so that is causing me problems but i am not sure why.... Anyone can help? (sorry couldnt post too much code...) thanks!
org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations):
and am not sure how it is happening...
What I am doing is this:
basically I am doing 3 things - adding some objects to the dataObject, deleting some services that are related to the dataObject and finally making couple of changes. the code is separate enough that there are 3 pieces instead of one huge piece. Basically it is a page with checkboxes. What I find to be the problem is this:
Scenario 1:
I run add, then delete service then make some updates - i get this cascade error when i am trying to remove all objects.
Scenario 2:
I run add, then update then delete - i get another error that it is expecting row count 1 when i really should have 0.
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
Scenario 3:
if i remove the update part of the code everything works fine - i am not sure why that part of the code
Note that these errors ONLY show up if i were to remove every "service" under dataObject. You can think dataObject as a form with 4 checkboxes and I am basically unchecking/checking them and then "save". If I check 2 and uncheck the other 2 everything's fine. If I uncheck them all then i get the errors. The service update is another check box for something else but under same dataObject so that is causing me problems but i am not sure why.... Anyone can help? (sorry couldnt post too much code...) thanks!