-->
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.  [ 7 posts ] 
Author Message
 Post subject: what record causing the error after commit ?
PostPosted: Fri Jul 29, 2005 6:41 am 
Newbie

Joined: Fri Jul 15, 2005 6:35 am
Posts: 12
My program read a ascii file with 1000 records.
I read 100 rows at a time and perform saveOrUpdate on oracle db.
During the commit, i catch an exception.
How can I determine what is the record causing the problem ?

Oracle only tell an error.
HibernateException don't tell me more.

What is your opinion ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 8:28 am 
Newbie

Joined: Fri Jun 24, 2005 3:32 pm
Posts: 11
Without the exception code, it would be difficult to say. Can you post it?

Also, it may have something to do with your DB connection on commit, rather than a record on commit. Try reading the first record, and running a saveOrUpdate, and see if you still get the exception. If you do, it's probably not the record.


Top
 Profile  
 
 Post subject: Re: what record causing the error after commit ?
PostPosted: Fri Jul 29, 2005 9:00 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
bluca wrote:
My program read a ascii file with 1000 records.
I read 100 rows at a time and perform saveOrUpdate on oracle db.
During the commit, i catch an exception.
How can I determine what is the record causing the problem ?

Oracle only tell an error.
HibernateException don't tell me more.

What is your opinion ?


If you're just trying to debug a specific problem, I would suggest performing the commit after each record and you'll know exactly which one is failing.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 9:18 am 
Newbie

Joined: Fri Jul 15, 2005 6:35 am
Posts: 12
I don't want to find the record that cause the error,
I want to find the way to write a error log that exactly identify the records that are wrong.

In this way, my user read the log, find exactly information about the wrong record.
Open the ascii file with an editor.
Correct the problem and then try to import again.

(..sorry for my poor english...)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 9:36 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Not possible. Tom Kyte recently blogged about something that would make it possible: http://tkyte.blogspot.com/2005/07/how-cool-is-this.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 9:36 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
bluca wrote:
I don't want to find the record that cause the error,
I want to find the way to write a error log that exactly identify the records that are wrong.

In this way, my user read the log, find exactly information about the wrong record.
Open the ascii file with an editor.
Correct the problem and then try to import again.

(..sorry for my poor english...)


I don't think you'll find too many people here that think having database exceptions thrown and the users looking through logs for errors is a good practice.

What are the possible reasons for exceptions that you can correct ? My assumption is that it has to do with bad data and, in my opinion, data should be validated PRIOR to passing it on to the database.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 01, 2005 11:25 am 
Newbie

Joined: Fri Jul 15, 2005 6:35 am
Posts: 12
I must populate a oracle db exporting data from a legacy proprietary database.
The old db must feed the new one in real time.
Technical people must control this batch procedure,
reading logging for failure, and correct the source data.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.