How are you accessing the entity beans?  If you access like this:

void clientMethod()
{
   foo = bean.getFoo();
   bar = bean.getBar();
}

...then each of those methods are going to run in a separate
transaction, and the bean will probably be loaded separately for each
method call.  Two database hits.

If you put both of those gets in a single session bean method, the
method will demarcate a single transaction and thus the bean will only
be loaded once.  This is why it's a good idea to always wrap your entity
beans in session beans - you have much better control of transactional
behavior.

Jeff Schnitzer
[EMAIL PROTECTED]

> -----Original Message-----
> From: Eric Jain [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 07, 2002 7:16 AM
> To: Jboss-User
> Subject: [JBoss-user] Scheduled class slow when bundled with beans
> 
> I bundled a scheduled class together with the entity beans it uses so
it
> can
> access them directly. Previously the scheduled class had to access the
> entity beans through a session bean, since the entity beans only have
> local
> interfaces (CMR...). Instead of observing increased performance as a
> result
> of removing this level of indirection, everything slowed down by a
factor
> of
> 10. Does anyone have enough insight here as to why such a thing would
> happen?
> 
> 
> --
> Eric Jain
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to