Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Attempting to execute an operation on a closed EntityManager(Eclipse Link 2.6.0 with JBoss 7.0.A)
Attempting to execute an operation on a closed EntityManager [message #1772500] Mon, 11 September 2017 14:42 Go to next message
Sahil Shivhare is currently offline Sahil ShivhareFriend
Messages: 1
Registered: September 2017
Junior Member
The EntityManager has closed after few operation

Getting below exception
java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManager.

19:43:48,019 ERROR [stderr] (default task-5) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.verifyOpen(

19:43:48,019 ERROR [stderr] (default task-5) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.setParameter(

19:43:48,019 ERROR [stderr] (default task-5) at com.thehartford.comml.ods.dao.GenericDAO.findByNamedQuery(

19:43:48,020 ERROR [stderr] (default task-5) at com.thehartford.comml.ods.dao.TypeDAO.getTypeByName(

19:43:48,020 ERROR [stderr] (default task-5) at com.thehartford.comml.ods.dao.AgreementDAO.getAgrmntByPolicyOrPolcyTermByCriteria_801(

19:43:48,020 ERROR [stderr] (default task-5) at

Refer to the attached persistent.xml

Spring config file

<bean id="emf"
<property name="dataSource" ref="dataSource" />
<property name="loadTimeWeaver">
class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
<property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
<property name="persistenceUnitName" value="JUnit_Persistence" />
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect" />

<bean id="jpaVendorAdapter"
<property name="database" value="ORACLE" />
<property name="showSql" value="true" />

Please help
Re: Attempting to execute an operation on a closed EntityManager [message #1772648 is a reply to message #1772500] Wed, 13 September 2017 14:42 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1342
Registered: July 2009
Senior Member
I'm not sure what help we can give - your code is holding onto an EntityManager that is being closed somewhere else. Check the code trying to execute this query and follow how it and the EntityManager that created it was obtained to find your problem. Or change your code to obtain a new EntityManager when required.

Best Regards,
Previous Topic: Migrating from Oracle Toplink to Eclipselink
Next Topic:Recovering from connection exceeded time limit
Goto Forum:

Current Time: Mon Apr 06 21:58:37 GMT 2020

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

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

Back to the top