Announcement Announcement Module
Collapse
No announcement yet.
Problem in executing hibernate queries using @Transactional Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in executing hibernate queries using @Transactional

    I have a simple method which inserts one record in one entity and update a record in another entity. I'm using @Transactional to have a transaction executing this method.
    Here is the problem :
    When I put the Insert before the update, only update is done but when I put update before Insert, both of them execute successfully!
    Also I set the Log4j to debug and attach the Spring source to my project. No matter which query executes at first, this line executes in the org.springframework.orm.hibernate3.HibernateTransa ctionManager : txObject.getSessionHolder().getTransaction().commi t();
    But the only thing which differs is that the Insert query never shows up when I put it before update!
    Besides I monitor the org.springframework.transaction.support.Transactio nSynchronizationManager.isActualTransactionActive( )
    in every steps of my program. It always returns true!!!

    Please help me.
    Thanks in advance.
Working...
X