• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Problem in Running Hibernate Sample application

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Code tag is added. Could you please look into this. Sorry for inconvenience.

HI experts,

I am trying to run the sample hibernate application from www.roseindia.com, but the session.save(object) does not insert the object in the oracle DB.Am not getting any errors or exceptions here is a snippet of the code :



Example given in roseindia:
=================




hibernate.cfg.xml:
===========




contact.hbm.xml:
--------------------


Please help me out to run this application.
Database: oracle10g
JDBC driver version is 10.2.0.1.0


--Regards
Dhanunjay Reddy V

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.

 
DhanunjayReddy Valluru
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Sample hibernate example in roseIndia is running with out any errors but not saving into the database. Its because they are not starting the transaction. Transacton object you have to get it from session. Once you persist the object, please commit the transaction. That will solve the problem. See the modified code below.





Thanks for all who has looked into this issue.

--Regards
Dhanunjay Reddy V
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic