Announcement Announcement Module
Collapse
No announcement yet.
what about transaction in spring + hibernate??? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • what about transaction in spring + hibernate???

    when using spring + hibernate, spring offer getHibernateTemplate()
    like this

    public void createInstructor(Instructor instructor) {
    getHibernateTemplate().save(instructor);
    }

    i really want to know this.
    in hibernate, wher transaction is commited ,data is inserted, updated.etc..

    so getHibernateTemplate() is warpping transaction??

    and one another question

    in this case, can i use weblogic transaction?

    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTran sactionManager">

  • #2
    Spring is normally used to manage transaction boundaries around service layer objects. So the HibernateTemplate doesn't itself manage transactions, but knows how to work with the correct Hibernate Session for the current transaction.

    Yes, you can use JTA transactions. If using WebLogic, use the WebLogicJtaTransactionManager, which offers more features than the plain JTA one.

    Comment

    Working...
    X