Hi all,

imagine, I have a table Foo with two rows, both Integers X and Y on my
relational database.

table Foo (X is the primary key!) with example data
X  Y
1  2
1  3
2  3
2  4

I read the first row (X=1, Y=2) into a CMP Entity Bean and overwrite y with
the Integer 4 (only inside the Entity Bean)
Now I call a finder method for y (declared with something like findByY(int
y) "y= {0}")
FooEntityHome.findByY(4);

Question: What happens inside a container, when I call this finder?
1. The Entity bean is written (with a real UPDATE sql command) to the
database, then a "SELECT x,y FROM Foo where y=<my y>" is executed and Entity
Beans are constructed to return them in the result
2. All rows of this table are loaded into Entity Beans, then the y variable
in the Entity Beans are iteratively looked through?
3. something else?

If I have 1 Billion rows in table Foo, option 2 is impossible of course,
but if option 1 is used, a real sql-SELECT is done in every case, so where's
the speed of the Entity Bean's cached data?

Maybe the implementations switch between option 1 and 2, depending on the
number of rows in the table...

Any comments?


thanks,
Heiko Seebach

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to