Hibernate version:
hibernate 3.1 + ejb3.
Hi.
I have a method in ejb3 stateless bean, which I'm tring to split there the initial transaction to two transactions.
meaning:
Code:
public @Stateless class XXXBean {
@PersistenceContext(unitName="ImagineDB")
private EntityManager manager;
public void someMethod() {
Dog dog = new Dog(); //dog is an entity bean;
manager.persist(dog);
manager.flush();
//here I want new transaction
manager.getTransaction().commit(); //this commands fails
Cat cat = new Cat();
manager.persist(cat);
}
}
Thanks in advance, amit