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:
Here is what my code looks like: http://pastebin.com/m22a9f6b
Here is the logging output: http://pastebin.com/m6da9383a
The test fails on step 12 (line 121).
As you can see, even though I have roll-backed the transaction, there is a record in the DB. Seems like transactions where not used at all and the record got through into the db.
Do you have any ideas how this could be happening and how to fix it?
I figured out I need to provide my own implementation of ConnectionProvider that would return XAConnection instead of simple connections. This way transactions seem to work