File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Global variables in SessionBeans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Global variables in SessionBeans?" Watch "Global variables in SessionBeans?" New topic
Author

Global variables in SessionBeans?

Murali Mohan
Ranch Hand

Joined: Jul 07, 2003
Posts: 47
Hi
Can we declare global variables in stateless and stateful session beans? How does container handles it?
Regards,
Murali
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Mohan,
The answer to this question is no. Non-final static variables are not allowed in any EJB.
The questions you are asking are very basic -- I understand that you are just starting out with EJB's, and that's great -- but all of the answers to these questions can be found in any of the basic texts on EJB's. I suggest you either read Ed Roman's "Mastering EJB" (which is available online at the ServerSide) or you buy a copy of Richard Monson-Haefel's "Enterprise JavaBeans".
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Global variables in SessionBeans?