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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -