Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Connection does not get closed after entityManager.getTransaction().commit(); call
Connection does not get closed after entityManager.getTransaction().commit(); call [message #1755660] Mon, 06 March 2017 16:19 Go to next message
ELUser Mising name is currently offline ELUser Mising nameFriend
Messages: 26
Registered: May 2013
Junior Member
We are noticing that the connections are not getting closed and released for a long time.

When entityManager.getTransaction().commit(); is called the connection is not released to the pool as expected and we have seen up-to 10 minutes delay.
But when we call connection.commit(); we see the connections immediately released.

Can someone explain why we see the delay in releasing the connection?


This is the entry we have in the persistence.xml for connection pooling

<property name="eclipselink.jdbc.read-connections.max" value="5"/>

<property name="eclipselink.jdbc.read-connections.min" value="1"/>

<property name="eclipselink.jdbc.read-connections.initial" value="1"/>

<property name="eclipselink.jdbc.read-connections.shared" value="true"/>

<property name="eclipselink.jdbc.write-connections.max" value="5"/>

<property name="eclipselink.jdbc.write-connections.min" value="1"/>

<property name="eclipselink.jdbc.write-connections.initial" value="1"/>
Re: Connection does not get closed after entityManager.getTransaction().commit(); call [message #1755686 is a reply to message #1755660] Mon, 06 March 2017 19:41 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
There are many other properties that might have an EntityManager hold onto a connection. Please check your other configuration such as if exclusive-connection.mode is specified - otherwise show all properties being used.
Re: Connection does not get closed after entityManager.getTransaction().commit(); call [message #1755690 is a reply to message #1755686] Mon, 06 March 2017 20:09 Go to previous messageGo to next message
ELUser Mising name is currently offline ELUser Mising nameFriend
Messages: 26
Registered: May 2013
Junior Member
Thanks for the reply.
The exclusive-connection mode is set to Transactional.
<property name="eclipselink.jdbc.exclusive-connection.mode" value="Transactional" />

I have attached the persistence.xml file
Re: Connection does not get closed after entityManager.getTransaction().commit(); call [message #1755691 is a reply to message #1755690] Mon, 06 March 2017 20:11 Go to previous message
ELUser Mising name is currently offline ELUser Mising nameFriend
Messages: 26
Registered: May 2013
Junior Member
Forgot to mention that we are using EclipseLink v2.4.2
Previous Topic:moxy is not able to convert a List<String> to JSON
Next Topic:Eclipselink 2.6.4 LEFT JOIN TREAT QUERY Not working properly
Goto Forum:
  


Current Time: Tue Mar 19 10:11:30 GMT 2024

Powered by FUDForum. Page generated in 0.02629 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top