> First, you are assuming that the EJB container initialize a new object each
> time it has to provide a new implementation for a component contract. But,
> depending of the container implementation it can be true or false. WebLogic,
> for example, uses pool of objects. JOnAS doesn't provide a new instance
> anymore.
Yes, you're right.

> Second, your "lazy load" technic doesn't take care about transaction
> isolation. Indeed, the ejbLoad() is called the first time you call the bean
> in a transaction. In pessimistic locking ejbLoad() has to get data from the
> database and lock the tuple in the database. If you delay the load in a
> service (method) the data can be inconsistent regarding the transactional
> state.
So you're saying, that I have to load all the
calculated data in ejbLoad() directly?

If, let's say, the container uses a pessimistic locking,
it will only lock the data from its table but not other
table. In my example (see my mail before), 
the container will lock the table "Enrollment" but 
doesn't lock the table "subject". 

So I think, it's okay, if I use this lazy loading 
and also init the transient variable at the ejbLoad().

Do I miss something?

Thanx,
-- 
---------------------------------------------------
Blasius Lofi Dewanto
---------------------------------------------------
OpenUSS - Open University Support System
http://openuss.sourceforge.net
---------------------------------------------------
E-Mail   : [EMAIL PROTECTED]
ICQ      : 39343280
---------------------------------------------------


----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to