Connection is not Associated with a Managed

Asked

Viewed 1,318 times

-1

One of our systems is showing the error below:

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

This mistake has happened a lot, but we are not able to identify the reason.

Googling, I saw that on this link: https://access.redhat.com/solutions/1437663 probably has some response on the case, however, as it is a private forum, I could not see.

Has anyone ever been there?

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

1 answer

2

I caught this error when I used the default setting to create Connections Pool in Jboss.
After researching I found that it was about how the validation configuration of the connections with the database contained in this Pool was being made.
In the documentation of Jboss EAP have an example configuration with the Postgresql database. Possibly a valid setting so that this error does not occur would be:

<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>

Trimming the class defined in Valid-Connection-Checker is the one that does the right job to evaluate connections that are invalid with the database.

Att.,

Silas.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.