Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Challenge ! Hibernate, Spring and the Transactions...

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic