This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
What do you mean by "i have a other class in the session bean"? Do you have an inner class or another class within the same java file? You can solve your problem in two ways: one way is to pass the session context to the class� constructor, if it is instantiated inside of the session bean. Otherwise you can always define a business method like SessionContext getSessionContext() and have your private class calling it using normal jndi lookup, findByPrimaryKey(), etc. Because I doubt that session context object is serializable you can define this method only on the local interface. However you should ask yourself the obvious question how much sense does it make, from a designing perspective to define a business method that returns the session context? It would at least be acceptable if you could define an ejbHomeGetSessionContext() on the home interface, but this I guess is impossible since you need to return a reference to the current instance�s context. Regards.