Announcement Announcement Module
Collapse
No announcement yet.
Spring + Hibernate + Quartz Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + Hibernate + Quartz

    I am using Spring 1.2.6, Hibernate 3.0.1

    I have one interface and its implementor defined as

    Code:
    public interface A {
        public void methodA1() throws DataAccessException;
        public void methodA2() throws DataAccessException;
    }
    
    public class AImpl extends HibernateDaoSupport implements A {
       public void methodA1() {
             .....
       }
       public void methodA2() {
             .....
       }
    
    }
    I have applied transaction on method calls of A >> AImpl using spring's decalrative transaction.
    So when method of A >> AImpl is called, transaction starts and commited when execution returns from the method.

    Consider the following code, where "a" is a reference of interface A
    Code:
    ....
    a.methodA1();
    
    ....[some other code here]
    
    a.methodA2();
    
    ....
    In the above example, when methodA1() is called, transaction is started and commited when returned from methodA1(). When methodA2() is called, again transaction is started and commited when returned.

    What I want to do, I want to run these two method calls in the same transaction.
    How can I do that?
    I think, I have to start the transaction programmatically and attach it to the current thread beore calling methodA1() and commite it when returned from methodA2().
    How can I do it?
    Last edited by avi129; Jan 19th, 2006, 12:47 AM.

  • #2
    I solved the problem using org.springframework.transaction.support.Transactio nTemplate.

    Comment

    Working...
    X