java - Why session.refresh(Object, LockMode.UPGRADE) is deprecated in hibernate? -
my requirement:
i using quartz cron
triggering purpose, many triggers running on same row base on different column. when trigger need update related column. trigger first refresh(session.refresh(object)
) object belong it(object selected @ starting of trigger) database , take upgrade lock
@ row level. if success on getting lock update column , use session.update(object)
update in db. , release lock.
what alternative of session.refresh(object, lockmode.upgrade)
, efficient way avoid dirty update using hibernate ?
why deprecated in hibernate ?
what alternative of
session.refresh(object, lockmode.upgrade)
, efficient way avoid dirty update using hibernate ?
right there in the documentation:
deprecated.
lockmode
parameter should replacedlockoptions
e.g., use refresh(object,lockoptions)
.
it doesn't why, it's clear instead. (and there lockoptions.update
.)
Comments
Post a Comment