hibernate-entitymanager

Hibernate EntityManager + JOTM: transactions are not used

I am trying to integrate together JOTM and Hibernate EntityManager to test my EJBs in a transactional manner environment but out-of-container. My test looks like the following: Start JOTM Put JOTM's UserTransaction into JNDI Create and configure StandardXADataSource Put the DataSource into JNDI Configure hibernate and create EMF Creat...

Can a single EntityManager (Hibernate) participate in multiple concurrent transactions?

Hi! Is there a way one EntityManager can participate smoothely in multiple concurrent transactions? Well, not that concurrent. Something like: Start tx 1 Do stuff in tx 1 Start tx 2 Do stuff in tx 2 Commit tx 2 Join tx 1 back Do stuff in tx 1 Commit tx 1 with steps followed one by one not overlapping. ...

How to detect transaction conflicts with Hibernate?

I am using Hibernate 2.6 with hibernate-entitymanager. I am trying to catch and handle situations when 2 transactions conflict on an object. Here is what happens: Two threads are updating a single object wich has a @Version field. The thread which looses commit race logs StaleObjectStateException on flush. The exception is not thrown, i...

hibernate, mysql, glassfish v3, and JTA datasource

I'm attempting to use hibernate entity manager with mysql and glassfish. I'm getting the following error when attempting to use a JTA datasource: Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFact...

Spring, Hibernate, EntityManager and class inheritance

Hi, I'm pretty much new to Spring & Hibernate. In our team, we are building a web application using Struts 2 for the presentation layer, with Spring 3 and Hibernate 3 (with Annotations) underneath. We are still debating on whether to use DAOs or not and Session's or EntityManager's for CRUD operations. Setting aside the question of which...

JPA2 + Hibernate + Order By

Hi. Is it possible (using Hibernate and JPA2 Criteria Builder [1]) to order by a method's result rather than an entity's member? public class X { protected X() {} public String member; public String getEvaluatedValue() { // order by return "a status calculated with various members"; } } What I want to achive ...