hibernate - How to save without locking all the tables on grails -
i have domain class using domain class property city
:
class tracker { string name, value; city city; int hits; date date; }
and insert or update values using tracker.save();
in long job procedure.
that working fine except when want update on city domain class while tracker saving something. , says lock wait timeout exceeded; try restarting transaction. stacktrace follows: message: lock wait timeout exceeded; try restarting transaction
i don't make changes in city when saving tracker, think hibernate thinks , lock city domain too.
try tracker.save(flush: true)
or flush session after updates:
def sessionfactory sessionfactory.currentsession.flush()
Comments
Post a Comment