I have two objects of Classes A and B (both are mapped to the same table and have a in my hibernate configuration. The tag in both the objects also refer to the primary key of the table in the database.).
When users use my application, at one point in time Object A is updated. Later on Object B is updated. Sometimes, there is an exception that happens and I think its because I'm using mutliple objects like this (message printed below)
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):
Do i need to Override the equals method for these objects (as explained in this question?)