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(EntityManagerImpl.java:1924)

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

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

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

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

19:43:48,020 ERROR [stderr] (default task-5) at com.thehartford.comml.ods.services.AgreementService.getAgrmntByPolicyOrQuote(AgreementService.java:145)


Refer to the attached persistent.xml

Spring config file

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

<bean id="jpaVendorAdapter"
class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<property name="database" value="ORACLE" />
<property name="showSql" value="true" />
</bean>

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: 1275
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,
Chris
Previous Topic: Migrating from Oracle Toplink to Eclipselink
Next Topic:Recovering from connection exceeded time limit
Goto Forum:
  


Current Time: Wed Dec 13 09:36:51 GMT 2017

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

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