This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insert doesn't work on hibernate

 
kapil munjal
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Whenever I try to insert data through hibernate into DB, it displays all the steps executed but it doesn't insert a new row into the database. Please tell me what could be the possible cause for this.

The code for my class is

Regards
Kapil
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing happens in a database without a transaction. Have a read of the linked Wiki entry and you should see how to fix this issue.
 
Vijay Gadde
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Replace your try block with this code and check what happens.
I can say that your missing the Transaction bit in your code

Regards,VIJAY
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic