我正在使用Quartz作业进行一些后端处理,这会导致批量上传到数据库。我明确地清理了下面给出的会议。
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()
}
}
}
}
我的进程在某些情况下运行良好,并且在几次成功执行后,我在日志中看到以下错误。我关闭服务器时看到同样的错误。我正在使用Grails 2.3.6和Postgres和Hibernate 3.6.x
非常感谢你的帮助!!!
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}