|
From: Jim E. <jd...@ca...> - 2005-01-06 17:28:58
|
Hi Folks, I'm wondering if it's possible to use PROPAGATION_REQUIRES_NEW *without* using JTA. I'm trying to use PROPAGATION_REQUIRES_NEW with the following simple setup (using spring-framework-1.1): HibernateTransactionManager whose sessionFactory is a LocalSessionFactoryBean, and the sessionFactory dataSource is a JDBC DriverManagerDataSource. This isn't yielding the results I want yet. I don't get any exceptions or obvious error output, but I don't get the transactional behavior I expect either. I'll need to do further work to diagnose, but first I just want to make sure that such a configuration is intended to work. Based on this post from Colin Sampaleanu, I suspect that JTA may be required: ---- REQUIRES_NEW actually just suspends the current transaction, and then starts a new, unrelated transaction transaction to run the contained code in. If you commit the inner, new transaction, then rollback the outer, the inner transaciton will still be committed, as they are unrelated. This should work properly inside any JTA environment (as long as spring can get at the jta transaction manager) and the model is also essentially the same as the requires new support in the EJB spec. ---- Thanks for listening, Jim Engquist |