Re: Fetching objects 1 by 1
Re: Fetching objects 1 by 1
- Subject: Re: Fetching objects 1 by 1
- From: Chuck Hill <email@hidden>
- Date: Tue, 30 Mar 2010 09:50:28 -0700
On Mar 30, 2010, at 4:51 AM, David Avendasora wrote:
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.
It is also possible to not get some rows in any batches, i.e. if an
unprocessed row "migrates" to the batch you just procesed.
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.
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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