dukehoops02 wrote:
Is the above scenario possible? I thought once Session(A) reads entity as Obj1 the table's locked until Session(A) terminates. If not, is there any way to make Session(B) block on select until Session(A) is done?
The table is not locked if you've only done a read. If you did the read with LockMode.UPGRADE, which turns "select xxx from ..." into "select xxx for update from ...", then you would lock the table, and that will cause session B to block, like you want.
Unfortunately, not every DBMS suppoorts select ... for update. I don't believe that MySQL does.