A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Certification
»
EJB Certification (SCBCD/OCPJBCD)
Author
Diffrence between @EJB and SessionContext.getBusinessObject(InterfaceName.class) ?
rutuparna lastname
Greenhorn
Joined: Aug 01, 2009
Posts: 4
posted
Aug 03, 2012 12:06:59
0
May I know which to use when ?
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 1040
I like...
posted
Aug 04, 2012 01:48:22
0
Hi Rutuparna
@EJB is used to inject an
EJB
in your (client) code.
SessionContext.getBusinessObject(InterfaceName.class) is used to get a reference to "your own" EJB (and pass it for instance to another EJB), as you can't use the "this" keyword.
Regards,
Frits
I agree. Here's the link:
http://aspose.com/file-tools
subject: Diffrence between @EJB and SessionContext.getBusinessObject(InterfaceName.class) ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter