On Sep 29, 2008, at 8:39 AM, Glauber Ferreira wrote:
Hi all.
I need to rollback transactions in order to revert all data modified
(deleted, updated, created) by my tests. How can I do that in the
test code
listed in this link:
http://openejb.apache.org/3.0/unit-testing-transactions.html
S
> Marcin,
> the strategy you suggest should also work and is especially good for
> prototyping or smaller projects.
>
> In our case where we have a huge application with (>1.5 Mio LoC, > 1000
> EJBs, > 100 database tables with complex relationships) we cannot drop
> (or
> empty) and create tables
Marcin,
the strategy you suggest should also work and is especially good for
prototyping or smaller projects.
In our case where we have a huge application with (>1.5 Mio LoC, > 1000
EJBs, > 100 database tables with complex relationships) we cannot drop (or
empty) and create tables in junit tests
[Marcin Kwapisz]
I do not understand why you want to rollback committed transaction, especially
in unit test. Even, I do not know how to do it in JEE application.
Maybe our way will suit you:
1. set drop and create strategy in persistence.xml (property name depends on
JPA provider, we have sep
We are also using openejb for junit testing. In our tests we are using
UserTransaction to control the test data. Maybe this approach might also
work for you.
Below is the basic code, the startup and shutdown of the container, as
well as starting/stopping transaction could also be moved to a b