• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session onject throwing exception when trying to save a object or begin a transaction

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have written a simple hibernate code to save an object. When I type session.save(0 or session.beginTransaction(), it is throwing an exception. My code is given below



The output is
 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same thing is happening if I try to start a Transaction too.

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show us the mapping and hibernate configuration file?
 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hibernate Mapping File



Hibernate Cfg file

 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I try the example given on RoseIndia website it is working. I am really not able to identify what the fault is.
 
Samrat Gadamsetty
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
print the exception full stack trace and see you can find anything useful...
 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I started the server too
Server info displayed is

root
localhost
/var/run/mysqld/mysqld.sock

MySQL 5.1.41-3ubuntu12.6
localhost
127.0.0.1
 
Samrat Gadamsetty
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change the code in ( probably it may work..I'm not sure..)

SessionFactory sessionFactory=new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
and run with exception full stack trace...
we hope the best..
 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue got resolved as I placed an higher version of mysql jar file
reply
    Bookmark Topic Watch Topic
  • New Topic