Filipe Névola
Interesting points about the use of Spring Transactional

The use of Spring Transactional nowadays is very common but some aspects of this part of Spring framework are not so explored.

What we do constantly is annotate a class as @Transactional and on each method put the desired behavior with variations of Propagation, Isolation and Timeout properties when necessary.

Now lets see some other points:

1 - Spring does not support transactions propagation across remote calls.
In this case you should use EJB but be careful because in most cases you don’t need or don’t want rollback yours changes because of one expcetion in a remote call.

2 - Spring does not support self-invocation by default, that means a method within the target object calling another method of the same target object will not create a transaction even if the method called has @Transactional set.
In this case you can use AspectJ with Spring Transactional to get this working.

3 - Spring only supports transactions in public methods because with others visibilities modifiers Spring Proxy can’t found the element to apply the transactional control.
In this case you should use AspectJ too and pay attention because if you annotate a private/protected/package method with @Transactional the application will work fine but this method is not transactional.

4 - Spring can manage transactions in any environment.
Is not necessary to use an application server, your application will work correctly in tomcat, by example. The good point here is that the opposite is not true, then you can user Spring Transactional in your application server even with JTA transactions. To better integration with some application servers Spring provides adapters, we can find adapters for IBM WebSphere, BEA WebLogic Server, and Oracle OC4J.

You can see this points and more about Spring Transactional in Spring Reference:
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/transaction.html#transaction-declarative

Feel free to suggest other points to me and we can improve this post.

tecsinapse:

Algumas vezes precisamos criar um ambiente de desenvolvimento diferente do que usamos em nossa máquina para realizar algum passo atrelado ao desenvolvimento de um projeto (isto ocorre principalmente quando utilizamos o Windows =[) e isto pode ser um processo chato e demorado.

Neste post…

It is now official #OCJP 6 certified! :)

It is now official #OCJP 6 certified! :)

estudo muito profundo e espiritual do Pr. Leandro B. Peixoto #recomendo #biblia #ibcc

Frase de pará-choque: “Sê tu uma benção!”. Que assim seja!
Starting @tecsinapse blog setup! Check this out http://blog.tecsinapse.com.br/ #blog #tecsinapse #tumblr #notReady
Published my solution for Bean Scope that lives more than View and less than Session. BeingUsedScope https://bitbucket.org/filipenevola/filipe-nevola-helper/wiki/BeingUsedScope
Just created a new account at #bitbucket for my personal projects/repositories https://bitbucket.org/filipenevola/