Connection is not associated with a managed

-1

One of our systems is displaying the error below:

Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@437f90c8

This error has happened a lot, but we can not figure out why.

Searching on google, I saw that in this link: link probably has some answer on the case, however, as it is a private forum, I could not see.

Has anyone ever been through this?

javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Connection is not associated with a managed connection.org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@437f90c8 at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:261) at br.gov.frameworkdemoiselle.internal.proxy.QueryProxy.getResultList(QueryProxy.java:64)

We are using the demoiselle 2.4.2 framework, with Jboss AS 7.1 and postgre 9.x

    
asked by anonymous 21.05.2016 / 16:14

1 answer

1

I got this error when I used the default setting to create Connection Pool in JBoss.  After searching I found that it was about how the configuration of validation of the connections with the database contained in this Pool was made.  The documentation for the JBoss EAP has an example with the PostgreSQL database. Possibly a valid configuration for this error would not occur :

<datasources>
  <datasource jndi-name="java:jboss/PostgresDS" pool-name="PostgresDS">
    <connection-url>jdbc:postgresql://{ip_banco}:5432/{database}</connection-url>
    <driver>postgresql-{version}.jdbc4.jar</driver>
    <security>
      <user-name>{user}</user-name>
      <password>{password}</password>
    </security>
    <validation>
      <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"></valid-connection-checker>
      <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"></exception-sorter>
    </validation>
  </datasource>
</datasources>

Apparently the class defined in valid-connection-checker is the one that does the job correctly to evaluate connections that are invalid with the database.

Att.,

Silas.

    
25.05.2016 / 17:38