首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

[Relearn Spring] 四 Transaction Management

2012-10-09 
[Relearn Spring] 4 Transaction ManagementAnnotation based Management1. Use @Transactional along wit

[Relearn Spring] 4 Transaction Management
Annotation based Management
  1. Use @Transactional along with <tx:annotaion-driven/>
  2. Note: Calling a @Transactional method in the same class will not take effect if you are not using AspectJ for AOP.

It's OK to use HibernateTransactionManager with JdbcTemplate
  here it is:

引用This transaction manager is appropriate for applications that use a single Hibernate SessionFactory for transactional data access, but it also supports direct DataSource access within a transaction (i.e. plain JDBC code working with the same DataSource). This allows for mixing services which access Hibernate and services which use plain JDBC (without being aware of Hibernate)! Application code needs to stick to the same simple Connection lookup pattern as with DataSourceTransactionManager (i.e. DataSourceUtils.getConnection(javax.sql.DataSource) or going through a TransactionAwareDataSourceProxy).

热点排行