File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Ejbs and Static variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Ejbs and Static variables" Watch "Ejbs and Static variables" New topic

Ejbs and Static variables

Santhosh Kumar
Ranch Hand

Joined: Nov 07, 2000
Posts: 242
I wanted to know,
1. Can we have static variables in Ejbs from J2EE point of view
2. Does it affect the performance?
Your help is very much appreciated.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Static variables are allowed, however you should never write to them due to threading and clustering issues. It is good practice to make any static variables that you may use in your EJBs final also.
I agree. Here's the link:
subject: Ejbs and Static variables
It's not a secret anymore!