Memory leak, connection pool full; Question: with dao's in cdi (weld): when are connections closed?

122 Views Asked by At

My question is: if you work with dao's in cdi (weld), in weblogic e.g., when are connections opened and closed? We use session beans, container managed transactions.

We see:

weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resour   4205 ces currently available in pool VVVDB to allocate to applications, please increase the size of the poo   4205 l and retry..

Maybe it is because of the following dao:

@RequestScoped
public class RRRDaoImpl implements RRRDao {

    @PersistenceContext(unitName = "VVVDB")
    private EntityManager em;

    @Override
    public Boolean hasVVVIdRRR(String rrrKind, String externNummer, Long vvvId) {
        RRR reg = em.find(RRR.class, new RRRId(rrrKind, externNummer, vvvId));
        return reg != null;
    }

The persistence.xml looks like:

<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
    <persistence-unit name="VVVDB" transaction-type="JTA">
        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
        <jta-data-source>jdbc/VVVDB</jta-data-source>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect" />
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.format_sql" value="true" />
            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform" />
        </properties>
    </persistence-unit>
</persistence>
0

There are 0 best solutions below