tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebaxt <>
Subject Transaction when testing CRUD on facade
Date Fri, 28 Mar 2008 15:24:55 GMT


I'm new to openEJB and EJB3 so please forgive me if this is a stupid

Say I want to write a unitTest to test some CRUD methods on a facade. I have
a Session Bean with a method:

public X createNewX(String name) {
... creates newX
return newX;

The xxEAO is another Session Bean (the EAO pattern as explained in "EJB3 in

EntityManager em;
public void create(X newX) {

So the Facade creates a new X and delegates the EnitityManager actions to
the xxEAO.

In my unitTest(using embedded openEJB) I call the createNewX on the facade.
Now, my question is, do the facade create a transaction, and is the xxEAO
create() method invoked within this transaction? Or do I have to start a
transaction in the unitTest? 

The reason I'm asking is that the test succeeds, but the data isn't
committed to the database.



View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message