• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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