Hello, I'm new to hibernate so forgive me for a stupid question.
let's say I have 3 computers, Alice, Bob and Clare.
A mysql database is on Clare, containing my tables and data, of course both Alice and Bob can connect to the database.
I've developed a small Java application that runs both on Alice and Bob and uses hibernate to read and write data to Clare. The problem is that Alice can read something (say, a "Client") and she can modify it through her GUI while, at the same time, Bob can hit the "delete client" button in his GUI. As soon as he deletes the object, it is removed from his cache and from Clare. Alice, anyway, still sees that client in her GUI and keeps handling and modifying it, then saving to the database something that has been deleted by Bob.
How can I cope with this situation? How can I prevent Bob from altering something that, potentially, Alice is altering too?
Thanks for your time.
|