This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Ejbs and Static variables  RSS feed

 
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
Boost this thread!