-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to insert record in database
PostPosted: Thu Feb 24, 2005 8:35 am 
Newbie

Joined: Wed Feb 23, 2005 9:00 am
Posts: 8
[b]Hibernate version:2.1.3

[b]Mapping documents:-

[b]Code between sessionFactory.openSession() and session.close():

Mygroup g= new Mygroup();
g.setGroupid("GRTR1");
g.setGroupdescription("Trainee");
HibernateSessionFactory.currentSession().saveOrUpdate(g);
HibernateSessionFactory.closeSession();




[b]Full stack trace of any exception that occurs:warring is shown as follow
(util.JDBCExceptionReporter 34 ) SQL Warning: 5701, SQLState: 01000
(util.JDBCExceptionReporter 35 ) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context to 'rs'.
(util.JDBCExceptionReporter 34 ) SQL Warning: 5703, SQLState: 01000
(util.JDBCExceptionReporter 35 ) [Microsoft][ODBC SQL Server Driver][SQL Server]Changed language setting to us_english.

[b]Name and version of the database you are using:sqlServer



The problem is the object is not get persist in to the Database


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 24, 2005 9:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use the transaction API.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.