Mantis - Resin
Viewing Issue Advanced Details
5263 minor always 10-30-12 10:48 11-11-14 15:33
ferg  
ferg  
normal  
closed  
unable to reproduce  
none    
none  
0005263: entity-manager closed from scheduled-task
(rep by Riccardo Cohen)

I'm running resin 4.0.13, on linux debian/sun jdk.
I have some cron jobs launched by resin.xml configuration
<scheduled-task>. They work perfectly on my macosx (they are launched
every minute for testing purpose).On the production server some cron
jobs work all right while others have a strange error ;

java.lang.IllegalStateException: Attempting to execute an operation on a
closed EntityManager.
   at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.verifyOpen(EntityManagerImpl.java:1563)
   at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQueryImpl.java:693)
   at realty.Globalaction.reload_orgtables(Globalaction.java:947)
   at reacron.Cleancache.CleanOrgCache(Cleancache.java:33)
   at reacron.Cleancache.run(Cleancache.java:23)
   at
com.caucho.server.util.ScheduledThreadPool$TaskFuture.run(ScheduledThreadPool.java:591)
   at com.caucho.env.thread.ResinThread.runTasks(ResinThread.java:182)
   at com.caucho.env.thread.ResinThread.run(ResinThread.java:126)

This is the code at Globalaction.java:947

Query qr=m_manager.createQuery("select on from OrgNetwork on");
List<OrgNetwork> lst=(List<OrgNetwork>)qr.getResultList(); <=== this
line is 947

I suspect that at night time there is no particular activity on the
server, but why other cron jobs work all right?

m_manager is created by the resin.xml conf :

 <ejb-server data-source="realty/jdbc" create-database-schema="false"/>

I wonder why it is "closed"sometimes. I even don't know how to close it.

There are no notes attached to this issue.