Results 1 to 3 of 3

Thread: Cache + hibernate + backend thread problem

  1. #1

    Default 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. #2

    Default

    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

  3. #3

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •