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
Amita Mehta is currently offline Amita MehtaFriend
Messages: 23
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: 1275
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
Amita Mehta is currently offline Amita MehtaFriend
Messages: 23
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
Amita Mehta is currently offline Amita MehtaFriend
Messages: 23
Registered: May 2013
Junior Member
Forgot to mention that we are using EclipseLink v2.4.2
Previous Topic:Eclipselink error 3002
Next Topic:Exception in thread "main" Local Exception Stack:
Goto Forum:
  


Current Time: Thu Dec 14 13:29:39 GMT 2017

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

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