I think we are talking at cross purposes: I'm saying that Sybase has SELECT FOR UPDATE which will lock the row, however that is not used by Hibernate even when specifying that a pessimistic write lock mode should be used.
Unless I'm misunderstanding you, you're saying FOR UPDATE is not used because there is no FOR SHARE, right?
I think I mentioned that when I run some manual SQL with FOR UPDATE and sp_lock within same transaction to inspect, I can see the following:
Code:
fid spid loid locktype table_id page row dbname class context
--- ---- ---- --------- ---------- ----- --- ------------- ------------------------------ -------
0 555 1110 Ex_intent 1314100691 0 0 mydb Non Cursor Lock
0 555 1110 Ex_row 1314100691 124352 15 mydb Non Cursor Lock
0 555 1110 Ex_row 1314100691 171184 0 mydb Non Cursor Lock
It looks different when inspecting what Hibernate is doing (externally, using a sleep before transaction committed):
Code:
fid spid loid locktype table_id page row dbname class context
--- ---- ---- --------- ---------- ----- --- ------------- ------------------------------ -------
0 176 352 Sh_intent 1314100691 0 0 mydb Non Cursor Lock
0 176 352 Sh_table 1314100691 0 0 mydb Non Cursor Lock
0 176 352 Sh_row 1314100691 66294 0 mydb Non Cursor Lock
0 176 352 Sh_row 1314100691 67984 8 mydb Non Cursor Lock Range
So it definitely does not do a SELECT FOR UPDATE, and that's the locking aspect that affects my use case.