This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ejbs and Static variables

 
Santhosh Kumar
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Thanks,
Santhosh.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic