Search code examples
javajpaeclipselink

Internal pool and external pool usage


I develop non-JAVA EE application. From here

For non-Java EE applications, you typically use internal connection pools. By default, EclipseLink sessions use internal connection pools.

Besides I don't configure connection pool in persistence.xml. However in org.eclipse.persistence.core.log I see the following:

TRACE | Connection acquired from connection pool [read].
TRACE | reconnecting to external connection pool
DEBUG | SELECT * FROM test
TRACE | Connection released to connection pool [read].

Please, note reconnecting to external connection pool. Why external? How to explain it?


Solution

  • I found out the problem. In order to make EclipseLink use internal pool we must set in persistence.xml

    <property name="eclipselink.connection-pool.force-internal-pool" value="true"/>
    

    Hope it will save someone time.