欢迎来到天天文库
浏览记录
ID:42422996
大小:858.72 KB
页数:42页
时间:2019-09-14
《Spring中的事务管理》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、在说明Spring的事务管理之前,先说一下事务的4个特性,这四个特性简写为ACIDo1原了性(Atomic)2一致性(Consistent)3隔离性(Isolated)4持久性(Duraable)Spring中的事务管理有针对JDBCDataSource的org.springframcwork.jdbc.datasource.DataSourccTransactionManagcrXml代码1.2、taSourceTransactionManager〃>2.3.〈refboan二"dateiSourcc"/〉4.5.针对Hibernate的org.springframcwork.orm.hibernatc3・HibcrnatcTransactionManagcrXml代码1.3、actionManager〃>2.3.5.Spring2.5中源代码如下Java代码1.packageorg.springframework.orm.hibernate3;2.2.importjava,sql.Connection;4.3.importjavax.sql.DataSource;6.importorg・hibernate・ConnectionReleaseMode;import4、org.hibernate.FlushMode;importorg.hibernate.HibernateException;importorg.hibernate.Interceptor;importorg・hiberneitc・JDBCExccption;importorg・hibernate・Session;importorg.hibernate.SessionFactory;importorg.hibernate.Transaction;importorg.hibernate,exception.GenericJDBCException5、;importorg・hiberneitc・imp1.Scssionlmpl;importorg.springframework,beans.BeansException;importorg.springframework.beans.factory.BeanFactory;importorg.springframework,beans,factory.BeanFactoryAware;importorg・springframework・boans.factory.InitializingBcein;importorg・springframew6、ork・dao.DataAccessException;importorg.springframework.jdbe.datasource.ConnectionHolder;importorg.springframework,jdbe.datasource.DataSourceUti1s;importorg・springframework・jdbe・datasource・JdbcTransactionObjectSupport;importorg.springframework.jdbe.datasource.TransactionAwareD7、ataSourceProxy;importorg・springframework・jdbe・support・SQLErrorCodcSQLExccptionTranslator;importorg.springframework.jdbe.support.SQLExceptionTranslatorimportorg.springframework.transaction.ConnotCreateTreinsactionExccption;importorg.springframework.transaction.lllegalTransact8、ionStateException;importorg.springframework.transaction.InvalidlsolationLev
2、taSourceTransactionManager〃>2.3.〈refboan二"dateiSourcc"/〉4.5.针对Hibernate的org.springframcwork.orm.hibernatc3・HibcrnatcTransactionManagcrXml代码1.3、actionManager〃>2.3.5.Spring2.5中源代码如下Java代码1.packageorg.springframework.orm.hibernate3;2.2.importjava,sql.Connection;4.3.importjavax.sql.DataSource;6.importorg・hibernate・ConnectionReleaseMode;import4、org.hibernate.FlushMode;importorg.hibernate.HibernateException;importorg.hibernate.Interceptor;importorg・hiberneitc・JDBCExccption;importorg・hibernate・Session;importorg.hibernate.SessionFactory;importorg.hibernate.Transaction;importorg.hibernate,exception.GenericJDBCException5、;importorg・hiberneitc・imp1.Scssionlmpl;importorg.springframework,beans.BeansException;importorg.springframework.beans.factory.BeanFactory;importorg.springframework,beans,factory.BeanFactoryAware;importorg・springframework・boans.factory.InitializingBcein;importorg・springframew6、ork・dao.DataAccessException;importorg.springframework.jdbe.datasource.ConnectionHolder;importorg.springframework,jdbe.datasource.DataSourceUti1s;importorg・springframework・jdbe・datasource・JdbcTransactionObjectSupport;importorg.springframework.jdbe.datasource.TransactionAwareD7、ataSourceProxy;importorg・springframework・jdbe・support・SQLErrorCodcSQLExccptionTranslator;importorg.springframework.jdbe.support.SQLExceptionTranslatorimportorg.springframework.transaction.ConnotCreateTreinsactionExccption;importorg.springframework.transaction.lllegalTransact8、ionStateException;importorg.springframework.transaction.InvalidlsolationLev
3、actionManager〃>2.3.5.Spring2.5中源代码如下Java代码1.packageorg.springframework.orm.hibernate3;2.2.importjava,sql.Connection;4.3.importjavax.sql.DataSource;6.importorg・hibernate・ConnectionReleaseMode;import
4、org.hibernate.FlushMode;importorg.hibernate.HibernateException;importorg.hibernate.Interceptor;importorg・hiberneitc・JDBCExccption;importorg・hibernate・Session;importorg.hibernate.SessionFactory;importorg.hibernate.Transaction;importorg.hibernate,exception.GenericJDBCException
5、;importorg・hiberneitc・imp1.Scssionlmpl;importorg.springframework,beans.BeansException;importorg.springframework.beans.factory.BeanFactory;importorg.springframework,beans,factory.BeanFactoryAware;importorg・springframework・boans.factory.InitializingBcein;importorg・springframew
6、ork・dao.DataAccessException;importorg.springframework.jdbe.datasource.ConnectionHolder;importorg.springframework,jdbe.datasource.DataSourceUti1s;importorg・springframework・jdbe・datasource・JdbcTransactionObjectSupport;importorg.springframework.jdbe.datasource.TransactionAwareD
7、ataSourceProxy;importorg・springframework・jdbe・support・SQLErrorCodcSQLExccptionTranslator;importorg.springframework.jdbe.support.SQLExceptionTranslatorimportorg.springframework.transaction.ConnotCreateTreinsactionExccption;importorg.springframework.transaction.lllegalTransact
8、ionStateException;importorg.springframework.transaction.InvalidlsolationLev
此文档下载收益归作者所有