Can we use static variables in any type of EJB.If so what r the uses of using static variables in EJb.
If not why cannot we them in EJB?
Waiting for reply.
-
Static Varialbes In EJB (2 messages)
- Posted by: Web Master
- Posted on: July 24 2000 01:46 EDT
Threaded Messages (2)
- Static Varialbes In EJB by Dimitri Rakitine on July 24 2000 19:52 EDT
- Static Varialbes In EJB by Gene Florintsev on July 25 2000 13:22 EDT
-
Static Varialbes In EJB[ Go to top ]
- Posted by: Dimitri Rakitine
- Posted on: July 24 2000 19:52 EDT
- in response to Web Master
Yes, you can use static variables, but they should be read-only (final that is). The reason for this is a *possible* clustering. -
Static Varialbes In EJB[ Go to top ]
- Posted by: Gene Florintsev
- Posted on: July 25 2000 13:22 EDT
- in response to Web Master
It may be simpler to explain this if you give a scenario of why you may want to use non-final static variables.
Anyway, the EJB spec imposes very rigid limitations on the coding of EJBs. Some make perfect sense (do not start threads), some are almost meaningless IMHO (do not instantiate class loaders). The "do not use statics" is somewhere in the middle. You usually do not need it (and the spec prohibits it), but you might get away with it... That is until your deployer tool starts checking for it.
Gene Florintsev
gene at ejbility dot com