tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Cox <>
Subject Transactions controlled by Unit Tests
Date Tue, 12 Feb 2008 14:22:16 GMT

Is there a way in the 'out-of-container' testing paradigm with openejb for
the unit test method to control the demarcation of transactions?  

Here's the use case:
1) The unit test is doing entity bean testing, calling various methods on
the entity facade to test CRUD operations.
2) The unit test needs to demarcate transactions so that it can insert,
delete, then attempt to retrieve deleted entities.  Of course the last
retrieval should fail because the entity is deleted.  
3) But, JPA has the interesting behavior that deleted entities continue to
be accessible within the deleting transaction.
4) Therefore, the unit test needs to demarcate a transaction around the
delete so that the entity is really removed prior to the last retrieval

So, how can one demarcate transactions within a junit test case?



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

View raw message