Author: techfox9

JBoss vs WebLogic notes – persistence..

Friday, June 11th, 2010 @ 4:44 pm

In JBoss, this works:

List someBooks = em.createQuery("FROM Book b WHERE b.author=:name")
    .setParameter("name", "Sebastian").getResultList();

In WebLogic, I had to specify SELECTs:

List someBooks = em.createQuery("SELECT b FROM Book b WHERE b.author=:name")
    .setParameter("name", "Sebastian").getResultList();

If I have time, I will dig further and see why they behave differently but I suspect
that JBoss CMP is used automatically while in WebLogic, OpenJPA is used which
requires the “SELECT” syntax.

Good example on client transaction setup:

http://camelcase.blogspot.com/2009/04/how-to-call-remote-transactional.html

JBoss, Weblogic


 


Comments are closed.