That's right Howard. It's kind of a TomEE feature though. So what I blurted above is the safe bet. Anything you can 'get' local @inject, inter-app or inter-machine use @EJB Andy.
http://www.tomitribe.com - @AndyGeeDe - On a mobile device, and I have fat fingers. Sorry for typos. On 3 Oct 2014 07:55, "Howard W. Smith, Jr." <[email protected]> wrote: > Yes, I remember when I became TomEE user, I think Romain advised me that I > can use @Inject or @EJB. I decided to only use @EJB for EJBs and @Inject > for @SessionScoped, @ApplicationScoped, @RequestScoped beans. > > > On Fri, Oct 3, 2014 at 10:49 AM, <[email protected]> wrote: > > > Hi, > > I am not sure about that Alex. I use @Inject only and Stateless and stuff > > is working fine > > > > Skickat från min iPhone > > > > > 3 okt 2014 kl. 15:30 skrev Alex Soto <[email protected]>: > > > > > > Well I don't know exactly how EJB and CDI is managed internally by > TomEE. > > > But using @Inject whatever the class is will mean that the lifecycle of > > > that instance will be managed by CDI container. On the other side if > you > > > use @EJB the bean will be managed by EJB container, and this means EJB > > > lifecycle, and of course that your bean wil be transactional and you > will > > > be able to apply security concerns. > > > > > > Note that @Inject will make your bean be treated as POJO meanwhile @EJB > > > will mean that your bean will be treated as Enterprise Java Bean. > > > > > > As I said I am not 100% sure but I think this is how it works. > > > > > > 2014-10-03 14:19 GMT+02:00 Lars-Fredrik Smedberg <[email protected]>: > > > > > >> Hi! > > >> > > >> I'm trying to understand how I can use @Inject to inject EJBs. > > >> > > >> 1. If I want to inject an EJB that is packaged in the WAR together > with > > the > > >> code trying to inject it i assume I can use @Inject, correct? > > >> 2. As 1 but the EJB is packaged in a separate ejb-jar. I assume I can > > still > > >> use @Inject correct? > > >> 3. If the EJB is packaged in another WAR inside the same EAR or in > > another > > >> EAR I need to use @EJB correct? > > >> 4. In case 3 how do I adress the EJB? Where can I read more about the > > >> naming standard? > > >> > > >> Regards > > >> LF > > >> > > >> -- > > >> Med vänlig hälsning / Best regards > > >> > > >> Lars-Fredrik Smedberg > > >> > > >> STATEMENT OF CONFIDENTIALITY: > > >> The information contained in this electronic message and any > > >> attachments to this message are intended for the exclusive use of the > > >> address(es) and may contain confidential or privileged information. If > > >> you are not the intended recipient, please notify Lars-Fredrik > Smedberg > > >> immediately at [email protected], and destroy all copies of this > > >> message and any attachments. > > >> > > > > > > > > > > > > -- > > > +----------------------------------------------------------+ > > > Alex Soto Bueno - Computer Engineer > > > www.lordofthejars.com > > > +----------------------------------------------------------+ > > >
