|
From: <tri...@tr...> - 2003-10-21 02:47:33
|
Juergen, > We don't need to address that at the DataSource level. Why not simply execute > the series of SQL operations within a transaction? With > DataSourceTransactionManager or HibernateTransactionManager, > DataSourceUtils.getConnection will always return the same Connection within a > thread-bound transaction. JtaTransactionManager depends on the JTA > implementation; any reasonable one with local transaction optimization will > return the same Connection within a transaction too. > I was not just thinking about the Petclinic. I can see a general need for running a series of SQL statements or procedcure calls thet depend on running within the same connection - maybe there is some database state kept at the connection level or for some other reason. If we want to use the available Spring JDBC objects like SqlUpdate and SqlQuery for this, then this type of data source might come in handy. Thomas |