Results 1 to 2 of 2

Thread: what about transaction in spring + hibernate???

  1. #1
    Join Date
    Jan 2005
    Posts
    9

    Default 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">
    have a good day

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

    Default

    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.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

Similar Threads

  1. Replies: 3
    Last Post: Aug 16th, 2007, 12:10 PM
  2. Replies: 2
    Last Post: Aug 31st, 2005, 12:37 PM
  3. Replies: 0
    Last Post: Jun 6th, 2005, 06:22 AM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Transaction pb Hibernate/MySQL
    By syluser in forum Data
    Replies: 2
    Last Post: Aug 28th, 2004, 02:40 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
  •