posts - 4, comments - 5, trackbacks - 0, articles - 10

spring事务最佳实践

Posted on 2005-11-23 10:55 勇敢的心 阅读(210) 评论(0)  编辑  收藏

A good starting point for a small application with a couple of transactional business objects is the TransactionProxyFactoryBean. This option is easy to configure and provides enough flexibility for most needs.

For applications with several business classes that need transaction demarcations, we recommend using a parent/child setup . You specify a TransactionProxyFactoryBean as an abstract parent bean that has the base definitions. You can then easily reference this parent bean for any class that needs to have transactions applied without repeating all the configuration settings for all the classes.

If you have a really large application with many business objects, then you should consider using an auto-proxying solution. This includes both the BeanNameAutoProxyCreator and the DefaultAdvisorAutoProxyCreator mentioned earlier.

Annotations are going to see increased use once J2SE 5.0 is in widespread use. We believe that at that point, the annotation solutions discussed earlier in this chapter often will replace the other solutions entirely based on external bean configuration files.


只有注册用户登录后才能发表评论。


网站导航: