This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Application Frameworks and the fly likes Challenge ! Hibernate, Spring and the Transactions... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Challenge ! Hibernate, Spring and the Transactions..." Watch "Challenge ! Hibernate, Spring and the Transactions..." New topic
Author

Challenge ! Hibernate, Spring and the Transactions...

Benett Corp
Greenhorn

Joined: Dec 30, 2008
Posts: 2
Hello @ all !

I'm facing a problem with Hibernate, Spring and the transactions : "[save|createQuery] is not valid without active transaction". I'm using a datasource configured with Tomcat, and I want to use the AOP for the transaction management :


All things seems to be good in the log :


and if I call an update method on the session, I get an exception :

.. results in ..


Moreover, the transaction that seemed to be opened before just rollbacks !!


Any idea on this "double transaction" ?
[ December 30, 2008: Message edited by: Benett Corp ]
Benett Corp
Greenhorn

Joined: Dec 30, 2008
Posts: 2
Sorry for the smileys in the previous codes

By the way, when I replace the "save" call by a "throw new UnsupportedOperationException()", the rollbak seems to be processed...

Something important : when I use "session.beginTransaction()" and "session.getTransaction.commit()", everything works. owever, this is not the way i want to use transactions...

Anyone has already done some jobs about these transactions (spring + hibernate) ?
[ December 30, 2008: Message edited by: Benett Corp ]
 
 
subject: Challenge ! Hibernate, Spring and the Transactions...