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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -