Dashboard > SpringSide3 Wiki > ... > Reference > Transcation
  SpringSide3 Wiki Log In | Sign Up   View a printable version of the current page.  
  Transcation
Added by Calvin, last edited by Calvin on 2008-09-06  (view change)
Labels: 
(None)

1. 资料

2. in SpringSide 3

    因为不喜欢在配置文件里用AspectJ定义事务,宁愿使用Spring的@Transactional annotation在service层上进行标注。

    对于只读的方法,可以加入@Transactional (readOnly=true) 标注以提高性能。

    因为Spring默认只对RuntimeException进行rollback,所以:

    1.所有在service层方法中用throws定义的checkedException,都必须在@Transactional中定义rollbackclass。

    2.所有在service层方法中catch处理了的Exception,又希望Spring辅助rollback的话,必须重抛一个RunTimeException,SpringSide里预定义了一个统一的ServiceException。

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 2006-09-07) - Bug/feature request - Contact Administrators