-->
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.  [ 3 posts ] 
Author Message
 Post subject: Batch Processing Help
PostPosted: Mon Aug 28, 2006 4:11 am 
Newbie

Joined: Mon Aug 28, 2006 4:00 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0

Mapping documents:
hibernate.cfg.xml
input.hbm.xml
[...].hbm.xml
...

Code between sessionFactory.openSession() and session.close():

Well, my problem is not a code-related unknown error or something like that. My problem is: i need to do batch processing as it is shown i chapter 13:

http://www.hibernate.org/hib_docs/v3/re ... batch.html

The information is clear but i have an added issue that makes it more difficult.

Imagine my application must import files with a large amount of rows, but it only has to commit them IF the 90% or greater of the imported registers are correct (in format and in meaning). If there is a 10% or greater of bad registers, the file is discarted including all the correct registers in it.

If I do a commit of a part of the full amount of rows, how can I undo it if the file is finally discarted?

Thanks a lot for the help!



Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 9:01 am 
Senior
Senior

Joined: Wed Aug 17, 2005 12:56 pm
Posts: 136
Location: Erie, PA (USA)
I would think that a 2-step process would be best - Step 1: Import data and write to a "temporary" table. Validate and track the results. Step 2: If results of step 1 are satisfactory, move data from "temporary" table to actual db tables, otherwise, discard "temporary" table.

Curtis ...

_________________
---- Don't forget to rate! ----


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 4:59 am 
Newbie

Joined: Mon Aug 28, 2006 4:00 am
Posts: 2
Thanks!

I discussed it with my boss and we decided to divide the file in parts containing the maxium afordable register-count in a single session.

The fact is that a file with a high register count (which could cause memory problems - 10.000 regs or more) will only be charged in the initial instalation process of the SW we're developing and we won't need to do it again, once installed. After that, files to import will be small enough to let Hibernate manage them without problems.

Thanks for replying again.


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