On Saturday, Nov 23, 2002, at 19:55 Europe/Amsterdam, Dain wrote:

On Saturday, November 23, 2002, at 12:20 PM, Stefan Arentz wrote:

Dain, what you need is more real use-cases. This is really basic stuff which is used in most applications today. I'll be happy to provide you with more examples of such code that is now performing less optimal in JBoss. I might sound a bit negative but in reality I am *very* positive about JBoss, I just start knowing the code better and start seeing its limitations and strengths.
I'd kill to have more test cases and especially performance test cases. I would love to have tests the spit out a XML file with timings. Then we could quickly determine the results of a change.
And then create reports similar to the JUnit html output? Say a 'JBench' framework ... ?

So, here is my first take at the collection problem.

What is needed is something that Hibernate calls Lazy Loading or Lazy Initialization. This means that a call like getUsers() returns a smart collection that knows about the (SQL) query that backs it. I think almost *all* database access can be delayed, maybe even the initial select. Except when it is a SELECT FOR UPDATE .... statement i guess, I'm not sure about that.
Should be fairly easy. The collection is already a "smart" object.
Looking into this ...

What kind of access do we have to a Collection?

iterator() - should only call the original SELECT query and then fetch a result when Iterator.next() is called or DELETE when remove() is used.

add() - should only do a optional SELECT On the PK to prevent duplicates and then INSERT

remove() - should only do a SELECT on the PK to find out if the object was part of the collection and then DELETE
No... add and remove should (are?) delayed until the context completes (invocation or transaction). They should be preformed as a batch, but that is another story.
Is that what the spec says or just good design?

All this CMR stuff is really complicated :-) I'm now looking at the code of plugins/cmp/jdbc/bridge/RelationSet.java, which seems like a good starting point for these kinds of optimizations.

S.



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to