Announcement Announcement Module
No announcement yet.
Relationship between TransactionManager and Transaction Factory Class? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Relationship between TransactionManager and Transaction Factory Class?

    Inside Hibernate, I have tried to figure this out fully, but still donít quite understand the relationship between the TransactionManager, and the TransactionManagerFactoryClass???

    <bean id="txMgr" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager" p:sessionFactory-ref="mbuSessionFactory" p:dataSource-ref="mbuDataSource" />

    <utilroperties id="mbuHibernateProperties">
    <prop key="hibernate.transaction.factory_class">org.hibe rnate.transaction.JDBCTransactionFactory</prop>

  • #2
    There isn't a relationship...

    The TransactionFactory is used by hibernate to create/start a transaction, which to use depends on how you manage transactions (jta or not). The HibernateTransactionManager simply tells hibernate when to start and commit/rollback a atransaction..

    So from a spring perspective there is no relationship...


    • #3
      Thank you, so which on of these is responsible for starting the transaction, cause you mention that they are both doing that, so is there a parent-child transaction going on here? Do one of these classes call another?


      • #4
        I suggest you read the transaction chapter of spring and. Spring only delegates to the underlying mechanism so there is no parent/child transaction going on...

        As I already stated there is NO relationship and they do not know about each other.. (You also might want to read up on hibernate and transactions and how that internally works, take a look at the hibernate sources.)>


        • #5
          Thanks for the recommendations. I will read both of those.