Re: Fetching objects 1 by 1
Re: Fetching objects 1 by 1
- Subject: Re: Fetching objects 1 by 1
- From: David Avendasora <email@hidden>
- Date: Tue, 30 Mar 2010 07:51:33 -0400
If you go this route (something that uses a LIMIT fetch) then you have to be careful to make sure your SQL query is deterministic (sorting on the PK is a good way to do it). Otherwise it is possible that you will get the same row in two or more different batches.
How nulls are "sorted" is another potential issue with batching your result set. EOF considers nulls to be the smallest possible value, where Oracle considers it the largest. (yes, I know this isn't what is really happening, but that's the easiest way to explain it). If the DB does it one way and EOF does it the opposite, then you can end up with rows not in the order you were expecting. If you aren't batching then EOF wins and everything is fine, but with batching, the DB does the sort first using it's rules, then the batch is selected out of those results and then the batch is resorted by EOF using it's rules.
Neither of these things mean you can't use batching, but you must be aware of these potential issues and address them if they are a problem.
Dave
On Mar 22, 2010, at 5:55 PM, Chuck Hill wrote:
> You could fetch them in batches like ERXBatchingDisplayGroup does. That uses a LIMIT fetch, so you would need to be sure that objects don't get inserted during processing that affect previously processed batches. Otherwise... JDBC or low, low level EOF it is.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden