Announcement Announcement Module
Collapse
No announcement yet.
Cache + hibernate + backend thread problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cache + hibernate + backend thread problem

    Hello.

    I have problem with spring batch and cache .

    I run my simple job in main function.
    Problem is that my application doesn't ends hanging at the end of main function.


    In eclipse debbuger I can see that there are runing thread:

    Daemon Thread [MySQL Statement Cancellation Timer]
    Daemon Thread [net.sf.ehcache.CacheManager]
    Thread [org.hibernate.cache.UpdateTimestampsCache.data]
    Thread [org.hibernate.cache.StandardQueryCache.data]
    Source of this is hibernate cache configuration:

    #second level cache
    hibernate.cache.provider_class = org.hibernate.cache.EhCacheProvider
    hibernate.cache.use_query_cache = true
    hibernate.max_fetch_depth = 4
    hibernate.cache.use_second_level_cache = true
    hibernate.cache.region.factory_class = net.sf.ehcache.hibernate.EhCacheRegionFactory

    net.sf.ehcache.configurationResourceName = ehcache.xml

    If I delete lines above from configuration application terminates correctly.


    Any tips needed please...

  • #2
    I solved this problem adding code below to my application:


    CacheManager.getInstance().shutdown();
    Is it correct way ?
    Is it best way ?
    Is there better way ?


    Regards
    Marcin

    Comment


    • #3
      I've always been told that batch and object persistence mechanism don't play well together. That batch apps should instead make use of the JDBCtemplate.

      Food for thought,

      Jeff

      Comment

      Working...
      X