Hi,
I enabled @Transactional annotation and it seems that some methods are not transactional (they do not start a transaction). The annotated bean implements an interface (JDK dynamic proxy) and annotated methods are located in the bean (implementation).
For other beans it works properly but there's a light difference. The methods declared transactional are called internally (not via the interface).
I was wondering if my usage was write.
Actually, i used the pattern:
The do<MyMethod>* methods are declared transactional and are called by the <MyMethod> methods which are not transactional. The latters catch any RuntimeExceptions that can occur at commit time and log the exception (and rethrow them as checked exceptions not represented here).Code:public void create(Item item) { try { doCreate(Item item); } catch(RuntimeException e) { // log exception } } @Transactional public void doCreate(Item item) { .... }
I noticed that no transaction is started when the doCreate method is invoked from the create method. Can transactions be started from within the implementation bean or are they started only when manipulating the interface ?
Thanks for your help,
Luc


Reply With Quote