I’ve got a question. I’ve got an Manifest entity with an association to a Statusupdate entity.
In the Manifest-edit-screen, I have a button for opening a Statusupdate create screen, to create a Statusupdate.
When a Statusupdate gets created, a Statusupdate Entitylistener modifies the manifest, and changes the status of the manifest.
The problem occurs when I have a Statusupdate create screen, in which I also need to adjust attributes of the manifest.
After submitting the Statusupdate, and before returning to the manifest-edit screen, the Statusupdate entity listener triggers and adjusts the manifest.
When I press OK on the manifest edit screen, I get the notification “Object Manifest was modified in another transaction”, which makes sense, since the Manifest got an update by the Statusupdate EntityListener.
But although it makes sense, I can’t seem to work out a solution. I can’t make an exception in the listener since I need the logic there.
I’m pretty new to Java and Java persistence, so I’m not really experienced enough with the core details on persisting, transactions etc to work out a solution myself.
What should be the best way to approach this ?
Thanks for your time!