NovatecConsulting / BeanTest

Bean Testing for Java EE Applications
http://blog.novatec-gmbh.de/unit-testing-jee-applications-cdi/
Apache License 2.0
25 stars 12 forks source link

TransactionalInterceptor should be executed around other interceptors #4

Open agori opened 10 years ago

agori commented 10 years ago

EJB interceptors of a transactional EJB bean should be executed inside the same transaction of the intercepted bean. In BeanTest this doesn't happen because it seems that the TransactionalInterceptor is executed before application specific interceptors.

If the application specific interceptor works with the EntityManager, you get

javax.persistence.TransactionRequiredException: no transaction is in progress
carlosbarragan commented 10 years ago

We need to take a look at this. Maybe we need global interceptors to achieve this functionality.

bbq2100 commented 10 years ago

@carlosbarragan a word and a blow :wink: Please have a look in #10.

agori commented 10 years ago

This commit fixes the reported problem but opens another one: @ExcludeClassInterceptors is no more working and I suspect that per method EJB interceptors are not working as well.Thanks to the Murphy's Law, I have both ;)

bbq2100 commented 10 years ago

Hi @agori, thx for your fast feedback :) I will asap fix my shortcomings.