Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: About session closing in HibernateDaoSupport

  1. #11
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    I use Spring tx mgt with the Spring JtaTransactionManager. Under the covers it obtains and uses the JTA UserTransaction. This means that I get a consistent programming model--I can test with local transactions, such as JDBC, Hibernate or JDO transactions. Also, I get the value-added features of Spring's declarative transaction mgt that EJB CMT doesn't offer, such as rollback rules. And I can test my declarative tx mgt in integration tests outside the container, which is a real productivity gain in my experience.

  2. #12
    Join Date
    Sep 2004
    Location
    Argentina
    Posts
    23

    Default

    I use Spring tx mgt with the Spring JtaTransactionManager. Under the covers it obtains and uses the JTA UserTransaction
    Rod, i see from what you've posted, the benefits of using JtaTransactionManager. Now, what if i want to use Hibernate with HibernateDaoSupport? Is this transaction manager kept in the configuration? What other configurations do i have to consider in order to make things work in a distributed transaction environment as if i where using HibernateTransactionManager?
    I don't seem to understand the relation between Hibernate's transaction management and Spring's support for the former O/R mapping tool.

    Greetings
    - N!K -

  3. #13
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    The Hibernate support classes like HibernateTemplate and HibernateDaoSupport are agnostic to whether you are using HibernateTransactionManager or JTATransactionManager. To get the exact same semantics when moving from HibernateTransactionManager to JTATransactionManager, you would want to combine the latter with also using HibernateInterveptor on the tx declarations, otherwise Sessions will be bound on first creation, not at tx creation, but that's about it.
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. OpenSessionInView + CMT Session usage
    By alesj in forum Data
    Replies: 7
    Last Post: Aug 16th, 2005, 02:32 AM
  2. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  3. Replies: 3
    Last Post: May 16th, 2005, 07:04 AM
  4. Replies: 1
    Last Post: Mar 12th, 2005, 04:33 AM
  5. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •