Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Lars-Fredrik Smedberg
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 corr

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Alex Soto
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

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread karl . kilden
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 : > > 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

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Andy Gumbrecht
Basic rule these days is @inject local and use @EJB for remote beans. If in doubt use @EJB. That gives you all transactional state guaranteed. Andy On 3 Oct 2014 06:31, "Alex Soto" wrote: > Well I don't know exactly how EJB and CDI is managed internally by TomEE. > But using @Inject whatever the

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Howard W. Smith, Jr.
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, wrote: > Hi, > I am not sure about that Alex. I use

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Andy Gumbrecht
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:

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread hwaastad
...or use @inject all over and produce your remotes :-) br hw -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Regarding-Inject-vs-EJB-for-EJB-tp4672108p4672117.html Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Alex Soto
- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/Regarding-Inject-vs-EJB-for-EJB-tp4672108p4672117.html > Sent from the TomEE Users mailing list archive at Nabble.com. > -- Enviat amb Gmail Mobile

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread Romain Manni-Bucau
> br hw >> >> >> >> -- >> View this message in context: >> http://tomee-openejb.979440.n4.nabble.com/Regarding-Inject-vs-EJB-for-EJB-tp4672108p4672117.html >> Sent from the TomEE Users mailing list archive at Nabble.com. >> > > > -- > Enviat amb Gmail Mobile

Re: Regarding @Inject vs @EJB for EJB

2014-10-03 Thread John D. Ament
pecific your > > are tight to TomEE and won t be able to run on wildfly fir example > > > > El divendres, 3 octubre de 2014, hwaastad va > escriure: > > > >> ...or use @inject all over and produce your remotes :-) > >> > >> br hw > >> >

Re: Regarding @Inject vs @EJB for EJB

2014-10-05 Thread Lars-Fredrik Smedberg
hwaastad va > escriure: > > > >> ...or use @inject all over and produce your remotes :-) > >> > >> br hw > >> > >> > >> > >> -- > >> View this message in context: > >> > http://tomee-openejb.979440.n4.n

Re: Regarding @Inject vs @EJB for EJB

2014-10-06 Thread Romain Manni-Bucau
T+02:00 Alex Soto : >> > It is never late to know sth new. But then if this is TomEE specific your >> > are tight to TomEE and won t be able to run on wildfly fir example >> > >> > El divendres, 3 octubre de 2014, hwaastad va >> escriure: >> > >

Re: Regarding @Inject vs @EJB for EJB

2014-10-06 Thread Lars-Fredrik Smedberg
run on wildfly fir example > >> > > >> > El divendres, 3 octubre de 2014, hwaastad va > >> escriure: > >> > > >> >> ...or use @inject all over and produce your remotes :-) > >> >> > >> >> br hw > &

Re: Regarding @Inject vs @EJB for EJB

2014-10-06 Thread Romain Manni-Bucau
t is never late to know sth new. But then if this is TomEE specific >> your >> >> > are tight to TomEE and won t be able to run on wildfly fir example >> >> > >> >> > El divendres, 3 octubre de 2014, hwaastad va >> >> escriure: >>