> I think this is not perfect solution as EJB should not use static
> fields (see specs).


True, but this is a good solution for him (and does not violate
the spec.) It doesn't violate the spec because his EJB does not
have a static field in this scenario, it is accessing a static
method (getInstance() on the Singleton) but that is all.

The main driver against use of statics in the spec. is
that you cannot guarantee that multiple VMs are not involved.
In the case of an app. server that does load balancing, fail-over,
etc. (meaning not JOnAS :-) instances of a bean may be running
on multiple machines and would not share static data accross
the VMs. In his case this is fine since the Singleton is just
a cache of data that is in the RDBMS if he was running his
bean in 4 load balanced machines (with 4 VMs and 4 Singleton
instances) he will just have loaded the RDBMS data 4 times,
once for each VM.

Thanks,
Sean

----
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