Hi
I am afraid this is a common problem to Entity EJB both BMP and CMP also
some application server can do much better job at optimizing data access I
don't know any of them that can mach the speed of a SELECT statement.
To learn more why Entity EJB are small I suggest that you will look on a SQL
trace, for every simple find methods EJB generate much more SQL statement
then normally required to retrieve by a simple SQL.
EJB is a nice idea but many people find it does not scale well beyond the
trivial examples (Any other experience) I am think the correct way to work
is to write Session Beans that access the database either directly throw
JDBC or use some OR mapping tools like TopLink, JavaBlend or others (I don't
have any experience with those tools).
Regards,
Muly.
----- Original Message -----
From: Robert Hargreaves <[EMAIL PROTECTED]>
To: Jonas Users Group (E-mail) <[EMAIL PROTECTED]>
Sent: Tuesday, November 09, 1999 4:48 PM
Subject: jonas-users: Entity bean performance
> Dear All
>
> I'm not sure if this is a Jonas specific problem or simply an EJB problem
> but we have unsatisfactory performance when using CMP Entity beans.
>
> We have a tree structure search within a session bean and using entity
beans
> to do the search (the two methods at the end of the enclosed file that are
> remmed out) the search takes about 8 seconds. Using JDBC code acccess the
> database directly and bypass the entity beans (four methods under 'Op
> implementation' in the java file , no entity bean access) the search takes
> about 1 second (if that). Both tests are run on the same machine with the
> same data.
>
> All the entity beans called in the slow search are setup as TX_REQUIRED so
I
> presume it's not the transaction manager slowing things down. I know that
> with CMP there are a lot of SELECT statements issued to synchronise the
> entity beans and the database but does this allow for the huge difference
in
> performance? I have tried using the isModified feature but that doesn't
seem
> to make a difference either.
>
> I enclose a copy of the session bean implementation with both search
> implementations. There is only one remote method in this bean, the
> getEmployeesForUnit() method. Both search implementations return exactly
the
> same data.
>
> Regards
>
> Robert Hargreaves
> <<VariationsImpl.java>>
>