I use Quartz job to do some backend processing, which leads to bulk upload to the database. I am clearly viewing the session as shown below.
class MyService { def sessionFactory static transactional = false def runJob() { def collectionOfDomain = [] for { collectionOfDomain.add(someData) if(collectionOfDomain.size() == 200) { SomeDomain.saveAll(collectionOfDomain) sessionFactory.currentSession.flush() sessionFactory.currentSession.clear() collectionOfDomain.clear() } } } }
My process works fine for some instances, and after several successful executions, I see the following errors in the logs. I see the same error when shutting down the server. I am using Grails 2.3.6 and Postgres and Hibernate 3.6.x
Many thanks for your help!!!
Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0} ]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [ {DEFAULT=0}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$1] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$1@ 45331d5e]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Jul 24, 2014 7:27:46 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks SEVERE: The web application [] created a ThreadLocal with key of type [org.codehaus.groovy.grails.orm.hibernate.support.HibernatePersistenceContextInterceptor$2] (value [org.codehaus.groovy.grails .orm.hibernate.support.HibernatePersistenceContextInterceptor$2@ 1ecd29d0]) and a value of type [java.util.HashMap] (value [{DEFAULT=0}
source share