• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

commit data in hibernate template through spring

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic