-->
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.  [ 6 posts ] 
Author Message
 Post subject: Record Insertion problem?
PostPosted: Fri Jul 14, 2006 3:11 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 7:56 am
Posts: 20
Hi,

This is edward. I am using Hibernate. I have insert on record into table. But No error message display. But not Inserted. I am using mssql 2000.

I am getting only

Hibernate: insert into AuditFindingsFieldList (FieldTypeID, LookUpID, FieldCat, ParentFieldID, DefaVal, AllowNull, deleted, disabled, FieldID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)

what is the possibilites for not inserted records in hibernate.

even I did not get Errors/Exceptions.

Pls explain.

Thanks
A. Edward


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 5:47 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
You may need to commit the transaction.


Code:
  Session sess = factory.openSession();
  Transaction tx;
  try {
      tx = sess.beginTransaction();
      //do some work
      ...
      tx.commit();
  }
  catch (Exception e) {
      if (tx!=null) tx.rollback();
      throw e;
  }
  finally {
      sess.close();
  }


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 15, 2006 4:25 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 7:56 am
Posts: 20
Yes I did. but I got Exception like

Problem in getting the selection Query : org.hibernate.AssertionFailure: null id in entry (don't flush the Session after an exception occurs)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 15, 2006 4:26 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 7:56 am
Posts: 20
Yes I did. but I got Exception like

Problem in getting the selection Query : org.hibernate.AssertionFailure: null id in entry (don't flush the Session after an exception occurs)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 15, 2006 4:43 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
Have you set the ids for the objects being inserted?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 20, 2006 8:18 am 
Beginner
Beginner

Joined: Tue Jun 06, 2006 7:56 am
Posts: 20
Now I have No errors.
But Temporarily the record is displayed.
but not inserted in to the database.
I am using Display Tags in JSP for Record Display.

What I do?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.