Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

commit data in hibernate template through spring

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi List,

I am new to spring.

I have made a small example using spring and hibernate.

But when i am saving the data into database table its is not inserting the data into data base.It is storing in cache.

Below is my code.

applictionContext.xml


and DAO



and client




Please tell me where i am wrong.
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Basically, the database operations should normally run in a transactional context. So you need to explicitly commit the transaction to save or update your data to the database.
You need to explicitly do:


I would suggest that you use declarative transaction management using spring AOP. It is much flexible.

Regards,
Suhas
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic