Spring notes(五) - transaction

Spring transaction mechanism supports:

programming transaction

declaring transaction

I. Programming transaction:

At first, you should define a transactionManager which is the subclass derived from PlatformTransactionManager.

DataSourceTransactionManager: inject datasource instance to it.
JtaTransactionManager: no need to inject anything
HibernateTransactionManager: inject sessionFactory instance to it
JdoTransactionManager: inject persistenceManagerFactory instance to it

Then, inject these transactionManagers to JdbcTemplate, HibernateTemplate, JdoTemplate, sqlMapDaoTemplate respectively. All these templates encapsulate transaction [...]

By javafuns on March 18, 2008 at 22:54 · Views: 599 · Permalink · Leave a comment
Categorized in: Java · Tagged with: , ,
  • Highest Rated

  • My PicasaPhotos

    IMG_0614.JPG

    IMG_0615.JPG

    IMG_0696.JPG

  • RSS My del.icio.us

  • My RSS