Closed nsehgal closed 7 years ago
Save works for the first time, but trying again throws PooledConnection has already been closed error!!
ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - PooledConnection has already been closed.
ERROR org.grails.web.errors.GrailsExceptionResolver - SQLException occurred when processing request: [POST] /contract/save.json
PooledConnection has already been closed.. Stacktrace follows:
java.lang.reflect.InvocationTargetException: null
at grails.plugin.springsecurity.web.UpdateRequestContextHolderExceptionTranslationFilter.doFilter(UpdateRequestContextHolderExceptionTranslationFilter.groovy:64)
at grails.plugin.springsecurity.web.UpdateRequestContextHolderExceptionTranslationFilter.doFilter(UpdateRequestContextHolderExceptionTranslationFilter.groovy:64)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)
at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I think this has nothing to do with the plugin. It seems that there's some issue connecting with the database. Could you please repeat the same test but with a domain class without and ArrayType?
Thanks for the reply @ilopmar, I did the same test and it worked when there was no ArrayType save.
Versions of Hibernate and PostgreSQL Dependencies in my build.gradle
// Postgres compile 'org.postgresql:postgresql:9.4-1201-jdbc41' compile 'org.grails.plugins:postgresql-extensions:4.6.6'
//Hibernate classpath "org.grails.plugins:hibernate4:5.0.6"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
One more thing to add is my ArrayTypes are of type Enums and Strings and this happens on Querying too
def result = xxx.withCriteria{
eq('xxx', fullParams.xxx)
eq('xxx', fullParams.xxx)
pgArrayEquals 'xxx', fullParams.xxx// TODO not sure why is this throwing the Pooled Connection, after first normal run
order("created", "asc")
maxResults(1)
}
Could you please create a small sample project that reproduce the issue, push it to github and share here the link. This way I'll be able to debug the error.
@ilopmar Creating a sample made it clear its not the extensions plugin for the pooled connection error. Closing this issue.Thanks for ur help.
Thank you for letting me know.
Getting this error when trying to save an ArrayType in Postgres 9.4