• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Toplink-essentials JPA Provider

 
Mohammad Jaber
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have a Stange case with Toplink-essentials JPA Provider , iam using Bean Managed (application managed) EntityManager with ThreadLocal design for holding an instance of both EntityManagerFactory and EntityManager , when i try to get an instance of entitymanager through (emf.createEntityManager) the application hang , and without doing any thing , repeat running the application many many times makes it work , then it works fine for period of time , then it comes back to hang , and the same project works fine all the times when i used Hiberante EntityManager , any one can help on this , thanks in adnavce

Best Regards,
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the hang randomly occur, or just the first time your application accesses the EntityManager? The first time an EntityManager is accessed from the factory TopLink Essentials will connect to the database and initialize the meta-data, it could be that your database connect is hanging or taking a long time to connect.

If your still having issues try getting a stack trace from the hung process to see where it is hanging and include it in your post. Also include what application server you are using.

Also ensure you have the latest build of TopLink Essentials from Glassfish.
 
Mohammad Jaber
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Thanks for your reply , yes this happeneds randomly , and it hangs when it reaches "emf.createEntityManager" and nothing happeneds but sometimes it takes more than 2 min. to work but sometimes it fails , i can issue this problem run it from simple java application but iam useing IBM Websphere AS 6.1 , i checked the meta data and it looks fine to me , the worst thing it works sometime smoothly and from the first time , and another thing to add , the very same configuration and DB is working fine with Hibernate EntityManager , and about the lastest Toplink-essentials i tried multi versions ( on of them is the new 11g jar ) , but useless , any hints or ideas , Thanks
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could have something to do with WebSphere and the weaving that TopLink does. Hibernate does not use weaving so this may explain the difference.

Try disabling weaving in your persistence.xml ("toplink.weaving"=false).

Does the issue occur only inside WebSphere, or does it also occur in JSE, or in any other application server such as OC4J?

Can you get a stack trace to the hung process? In Linux send the kill -9 command to the Java process and it should dump the current stack from all threads. (only include the hung thread)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic