good point, to you have portability, use the following:
Context context = new InitialContext();
UserHome userHome = (UserHome)context.lookup("java:comp/env/ejb/sample10a.UserHome");
final User user = userHome.findByPrimaryKey(name);
But it only worked inside another EJB, I tryed it on a servlet and it doesn't worked.
Regard's
Marcelo Bellezo
"Rhodes, Phillip C." wrote:
In JRun examples, they have the following code snippet that will get the
local EJBHome object for this bean.
final User user =
((UserHome)ResourceManager.getLocalEJBHome("sample10a.UserHome")).findByPrim
aryKey(name);Although I love JRun :) I would like my code to not depend upon the
container. If I have already have an existing javax.ejb.SessionContext
object, how may I use this to objtain a reference to a local ejb home
object?Thanks.
Phillip Rhodes
[EMAIL PROTECTED]
Alcoa eCommerce
https://www.ALCOADIRECT.COM
826B Two Allegheny Center Pittsburgh, PA 15212
(412) 553-4900 (phone) (412) 553-2484 (fax)------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
