I'm trying to found out how hibernate deals with this situation.
2 + tomcat servers exporting the same interface via SOAP behind a load balanced switch.
First SOAP request comes in the row is pulled from the DB and a single column is changed, say column A1. The second SOAP request hits a different machine but pulls the same row and changes a different column, B1. They both commit but one the first update is lost.
Original row data is
A1 = 0
B1 = 1
First request gets the row, makes an object, sets the property, and commits it back
A1 = 1
B1 = 1
Second request is waiting on the lock, gets it and does an update with with original A1 val and its new B1 val.
A1 =0
B1 = 2
What we should have is A1=1 and B1= 2. I could write JDBC queries for this and just update the specific column. I can't really do too much locking because there are also thousands of simultaneous SELECT requests happening per second on the same data.
-Matt
|