Grails session handling in waiting thread with Hibernate and MySQL InnoDB -


in order realize client-side notifications in ajax-driven application developing grails (and gwt), have implemented service method block until being signaled. using monitor object wait signal. once signaled, thread query database new objects , return entities browser.

it working fine memory database not expect when use mysql database connector. happens: whenever findallby... call find objects created before request started.

the lifecycle of service method

  • request client
  • hibernate session being created grails
  • service querying database new objects
  • if there none: wait
  • incoming signal: query database new objects (does not new objects when using mysql, works fine memory db)

the mysql query log shows queries expected result of findallby... empty array.

i disabled query , second level cache. behaviour same no matter if data connection pooled or not.

what doing wrong? should close hibernate session? flush it? use transaction queries? or somehow enforce findallby... method query database?

just guess, sounds transaction isolation level problem experiencing phantom read. service need need transactional? if not set transactional=false in service.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -