Sure, i guess you have forgotten to do the transaction management on it : for example this works :
EntityManager manager = getJpaTemplate().getEntityManagerFactory().createEntityManager(); try { manager.getTransaction().begin(); Query query = manager.createQuery("UPDATE Profile p SET p.status=?1 WHERE p.status=?2"); query.setParameter(1, statusReplacing); query.setParameter(2, statusToReplace); query.executeUpdate(); manager.getTransaction().commit(); } finally { manager.close(); } } Not that with others providers, the begin/commit is not always necessary, this is why it's confusing. But the hibernate way seems the most logical. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984544#3984544 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984544 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user