> I think, however, that the process of grabbing primarykeys as to know
which
> entity beans are part of the requested result, should be relegated to the
> rdbms, by sending the appropriate Sql statements to it.

> Usually the rdbms will use well-cached indexes and will very often not
even
> have to hit the disk to tell you which primarykeys are part of the
> resultset. Then you can iterate (hasNext(), next() ) over these
primarykeys
> collections to grab their payload one by one in the entitybean container,
> where a decent number of them should still be kept in cache by the
container
> manager.

Out of curiosity, have you tried this approach with any relatively large
dataset? It seems like it would work pretty well in theory (as long as you
aren't the first person to run a query after startup...), but the question I
have is what to do about sorts and re-sorts - will it be better to
re-execute the session bean with the new sort predicate or to sort on the
entity collection you already have?

I'd assume the sql would generally be faster on the  assumption  that not
every row would be in the object cache in a large system. But I'm also
wondering if you could even write a comparator that would be as fast as a
sql sort because you have to check minimally the sort fields plus some sort
of equals function for the object, where the database would only have to
operate on the sort fields (and you could index and cache the popular ones).

On the other hand, if you put the sort capability into the session beans,
pretty soon you'd start to be tempted to use them as sort of read-only
entities since you have most of the data you are interested in anyway - wish
we could see about a 18 months into the future here and see if there's an
easy solution then....

BTW, now that we have a final (and it's awesome) I have a feature suggestion
for .1...

"jBossKey" - you hit it and an imitation console window for whatever ejb
server your management thinks you are using pops up!  ;-)

-d
----
Dan Kearns <[EMAIL PROTECTED]>



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to