You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by Mark Struberg <st...@yahoo.de> on 2009/01/26 12:56:44 UTC
Basic understanding of JPA EntityManager injection
Hi!
A little question about integrating handlers for a few very specific situations:
If we provide support for JPA, then the following annotations are often being used:
javax.persistence.PersistenceContext
javax.persistence.PersistenceContexts
javax.persistence.PersistenceUnit
javax.persistence.PersistenceUnits
They are really very handy, even if NO EJB container is involved.
So my question is: do we like to support this functionality in a standalone manner?
In other words:
if (!EJBContainer available) {
inject PersistenceContext and PersistenceUnit
}
This is the way Spring works, and I personally find this quite handy.
We could easily implement this in an own optional module.
WDYT?
LieGrue,
strub
Re: AW: Basic understanding of JPA EntityManager injection
Posted by Gurkan Erdogdu <gu...@yahoo.com>.
Hi Mark
Section 3.6 of the specification indicates that "Resources are always declared using XML".
I think that when the field declares Java EE resource annotations (like @PersistenceContext, @EJB, etc.), and also contains the BindingType then we can throw exception for the time being.
Thanks;
/Gurkan
________________________________
From: Mark Struberg <st...@yahoo.de>
To: openwebbeans-dev@incubator.apache.org
Sent: Tuesday, January 27, 2009 10:01:07 AM
Subject: Re: AW: Basic understanding of JPA EntityManager injection
Hi!
I'm currently implementing (at least I try) resource injection into fields.
So I extend
DefinitionUtil#defineInjectedFields(ComponentImpl<T> component)
to also handle resources:
Annotation[] bindingAnns = AnnotationUtil.getBindingAnnotations(anns);
Annotation[] resourceAnns = AnnotationUtil.getResourceAnnotations(anns);
(AnnotationUtil.getResourceAnnotations is new code)
And now the question:
May bindings and resources exist at the same time? I think the spec doesn't allow it, wdyt?
So this example is imho invalid:
@Searchengine @PersistenceContext
private EntityManager entityManager;
instead this has to be set via @PersistenceContex(unitName="searchengine") or something
But resources maybe can be defined with different deployment types in XML? So having one db for Mock and one for Production would be handy. Or don't we care about this yet?
LieGrue,
strub
--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am Mo, 26.1.2009:
> Von: Gurkan Erdogdu <gu...@yahoo.com>
> Betreff: Re: AW: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 22:50
> I did not look at in Resources section 3.6 in detail. But I
> think it adds BindingTypes to the Java EE resources.
>
> Specification does not redefine the Java EE resource
> injections, concepts are the same. Just add another
> injection model with using BindingTypes.
>
> /Gurkan
>
>
>
>
> ________________________________
> From: Mark Struberg <st...@yahoo.de>
> To: openwebbeans-dev@incubator.apache.org
> Sent: Monday, January 26, 2009 10:44:43 PM
> Subject: Re: AW: Basic understanding of JPA EntityManager
> injection
>
> Programming question:
>
> Should we treat PersistenceContext, PersistenceUnit as kind
> of a BindingType?
> I'm not sure about this. WDYT?
>
> LieGrü,
> strub
>
>
> --- Gurkan Erdogdu <gu...@yahoo.com> schrieb
> am Mo, 26.1.2009:
>
> > Von: Gurkan Erdogdu <gu...@yahoo.com>
> > Betreff: Re: AW: Basic understanding of JPA
> EntityManager injection
> > An: openwebbeans-dev@incubator.apache.org
> > Datum: Montag, 26. Januar 2009, 20:32
> > You are right Mark. If EJB container is in the
> scenario, EJB
> > container is responsible for handling these. If not,
> then
> > the OWB will inject these.
> >
> > There is also new resource injection defined in
> chapter 3.6
> >
> > /Gurkan
> >
> >
> >
> >
> > ________________________________
> > From: Mark Struberg <st...@yahoo.de>
> > To: openwebbeans-dev@incubator.apache.org
> > Sent: Monday, January 26, 2009 7:11:31 PM
> > Subject: AW: Basic understanding of JPA EntityManager
> > injection
> >
> > Humm, maybe I thought to complex about this the first
> time
> > and there are no interferences between
> PersistenceUnits in
> > EJB managed beans and PersistenceUnits in WebBeans at
> all?
> >
> > If there aren't any, then we could simply reduce
> the
> > logic to
> >
> > any @PersistenceContext,... in EJB will be injected by
> the
> > EJB container
> > any @PersistenceContext,... in WebBeans will be
> injected by
> > OWB.
> >
> > since
> >
> Persistence.createEntityManagerFactory("unitname")
> > will in both cases return the same instance (hopefully
> also
> > in more complex JNDI setups!)
> >
> > Any error in my reasoning?
> >
> > LieGrue,
> > strub
> >
> > --- Mark Struberg <st...@yahoo.de> schrieb am
> Mo,
> > 26.1.2009:
> >
> > > Von: Mark Struberg <st...@yahoo.de>
> > > Betreff: AW: Basic understanding of JPA
> EntityManager
> > injection
> > > An: openwebbeans-dev@incubator.apache.org
> > > Datum: Montag, 26. Januar 2009, 14:22
> > > to be more specific: this is about how to
> implement
> > the
> > > section
> > >
> > > 3.10. Support for Common Annotations
> > >
> > > of the spec. My fear is that the EJB container
> and
> > > OpenWebBeans interfere with each other in this
> domain.
> > >
> > > There is currently only the handling of
> @PostConstruct
> > and
> > > @PreDestroy implemented for beans under our
> control.
> > >
> > > LieGrue,
> > > strub
> > >
> > >
> > > --- Mark Struberg <st...@yahoo.de>
> schrieb am
> > Mo,
> > > 26.1.2009:
> > >
> > > > Von: Mark Struberg <st...@yahoo.de>
> > > > Betreff: Basic understanding of JPA
> EntityManager
> > > injection
> > > > An: openwebbeans-dev@incubator.apache.org
> > > > Datum: Montag, 26. Januar 2009, 12:56
> > > > Hi!
> > > >
> > > > A little question about integrating handlers
> for
> > a few
> > > very
> > > > specific situations:
> > > >
> > > > If we provide support for JPA, then the
> following
> > > > annotations are often being used:
> > > >
> > > > javax.persistence.PersistenceContext
> > > > javax.persistence.PersistenceContexts
> > > > javax.persistence.PersistenceUnit
> > > > javax.persistence.PersistenceUnits
> > > >
> > > > They are really very handy, even if NO EJB
> > container
> > > is
> > > > involved.
> > > >
> > > > So my question is: do we like to support
> this
> > > functionality
> > > > in a standalone manner?
> > > >
> > > > In other words:
> > > > if (!EJBContainer available) {
> > > > inject PersistenceContext and
> PersistenceUnit
> > > > }
> > > >
> > > > This is the way Spring works, and I
> personally
> > find
> > > this
> > > > quite handy.
> > > >
> > > > We could easily implement this in an own
> optional
> > > module.
> > > >
> > > > WDYT?
> > > >
> > > > LieGrue,
> > > > strub
Re: AW: Basic understanding of JPA EntityManager injection
Posted by Mark Struberg <st...@yahoo.de>.
Hi!
I'm currently implementing (at least I try) resource injection into fields.
So I extend
DefinitionUtil#defineInjectedFields(ComponentImpl<T> component)
to also handle resources:
Annotation[] bindingAnns = AnnotationUtil.getBindingAnnotations(anns);
Annotation[] resourceAnns = AnnotationUtil.getResourceAnnotations(anns);
(AnnotationUtil.getResourceAnnotations is new code)
And now the question:
May bindings and resources exist at the same time? I think the spec doesn't allow it, wdyt?
So this example is imho invalid:
@Searchengine @PersistenceContext
private EntityManager entityManager;
instead this has to be set via @PersistenceContex(unitName="searchengine") or something
But resources maybe can be defined with different deployment types in XML? So having one db for Mock and one for Production would be handy. Or don't we care about this yet?
LieGrue,
strub
--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am Mo, 26.1.2009:
> Von: Gurkan Erdogdu <gu...@yahoo.com>
> Betreff: Re: AW: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 22:50
> I did not look at in Resources section 3.6 in detail. But I
> think it adds BindingTypes to the Java EE resources.
>
> Specification does not redefine the Java EE resource
> injections, concepts are the same. Just add another
> injection model with using BindingTypes.
>
> /Gurkan
>
>
>
>
> ________________________________
> From: Mark Struberg <st...@yahoo.de>
> To: openwebbeans-dev@incubator.apache.org
> Sent: Monday, January 26, 2009 10:44:43 PM
> Subject: Re: AW: Basic understanding of JPA EntityManager
> injection
>
> Programming question:
>
> Should we treat PersistenceContext, PersistenceUnit as kind
> of a BindingType?
> I'm not sure about this. WDYT?
>
> LieGrü,
> strub
>
>
> --- Gurkan Erdogdu <gu...@yahoo.com> schrieb
> am Mo, 26.1.2009:
>
> > Von: Gurkan Erdogdu <gu...@yahoo.com>
> > Betreff: Re: AW: Basic understanding of JPA
> EntityManager injection
> > An: openwebbeans-dev@incubator.apache.org
> > Datum: Montag, 26. Januar 2009, 20:32
> > You are right Mark. If EJB container is in the
> scenario, EJB
> > container is responsible for handling these. If not,
> then
> > the OWB will inject these.
> >
> > There is also new resource injection defined in
> chapter 3.6
> >
> > /Gurkan
> >
> >
> >
> >
> > ________________________________
> > From: Mark Struberg <st...@yahoo.de>
> > To: openwebbeans-dev@incubator.apache.org
> > Sent: Monday, January 26, 2009 7:11:31 PM
> > Subject: AW: Basic understanding of JPA EntityManager
> > injection
> >
> > Humm, maybe I thought to complex about this the first
> time
> > and there are no interferences between
> PersistenceUnits in
> > EJB managed beans and PersistenceUnits in WebBeans at
> all?
> >
> > If there aren't any, then we could simply reduce
> the
> > logic to
> >
> > any @PersistenceContext,... in EJB will be injected by
> the
> > EJB container
> > any @PersistenceContext,... in WebBeans will be
> injected by
> > OWB.
> >
> > since
> >
> Persistence.createEntityManagerFactory("unitname")
> > will in both cases return the same instance (hopefully
> also
> > in more complex JNDI setups!)
> >
> > Any error in my reasoning?
> >
> > LieGrue,
> > strub
> >
> > --- Mark Struberg <st...@yahoo.de> schrieb am
> Mo,
> > 26.1.2009:
> >
> > > Von: Mark Struberg <st...@yahoo.de>
> > > Betreff: AW: Basic understanding of JPA
> EntityManager
> > injection
> > > An: openwebbeans-dev@incubator.apache.org
> > > Datum: Montag, 26. Januar 2009, 14:22
> > > to be more specific: this is about how to
> implement
> > the
> > > section
> > >
> > > 3.10. Support for Common Annotations
> > >
> > > of the spec. My fear is that the EJB container
> and
> > > OpenWebBeans interfere with each other in this
> domain.
> > >
> > > There is currently only the handling of
> @PostConstruct
> > and
> > > @PreDestroy implemented for beans under our
> control.
> > >
> > > LieGrue,
> > > strub
> > >
> > >
> > > --- Mark Struberg <st...@yahoo.de>
> schrieb am
> > Mo,
> > > 26.1.2009:
> > >
> > > > Von: Mark Struberg <st...@yahoo.de>
> > > > Betreff: Basic understanding of JPA
> EntityManager
> > > injection
> > > > An: openwebbeans-dev@incubator.apache.org
> > > > Datum: Montag, 26. Januar 2009, 12:56
> > > > Hi!
> > > >
> > > > A little question about integrating handlers
> for
> > a few
> > > very
> > > > specific situations:
> > > >
> > > > If we provide support for JPA, then the
> following
> > > > annotations are often being used:
> > > >
> > > > javax.persistence.PersistenceContext
> > > > javax.persistence.PersistenceContexts
> > > > javax.persistence.PersistenceUnit
> > > > javax.persistence.PersistenceUnits
> > > >
> > > > They are really very handy, even if NO EJB
> > container
> > > is
> > > > involved.
> > > >
> > > > So my question is: do we like to support
> this
> > > functionality
> > > > in a standalone manner?
> > > >
> > > > In other words:
> > > > if (!EJBContainer available) {
> > > > inject PersistenceContext and
> PersistenceUnit
> > > > }
> > > >
> > > > This is the way Spring works, and I
> personally
> > find
> > > this
> > > > quite handy.
> > > >
> > > > We could easily implement this in an own
> optional
> > > module.
> > > >
> > > > WDYT?
> > > >
> > > > LieGrue,
> > > > strub
Re: AW: Basic understanding of JPA EntityManager injection
Posted by Gurkan Erdogdu <gu...@yahoo.com>.
I did not look at in Resources section 3.6 in detail. But I think it adds BindingTypes to the Java EE resources.
Specification does not redefine the Java EE resource injections, concepts are the same. Just add another injection model with using BindingTypes.
/Gurkan
________________________________
From: Mark Struberg <st...@yahoo.de>
To: openwebbeans-dev@incubator.apache.org
Sent: Monday, January 26, 2009 10:44:43 PM
Subject: Re: AW: Basic understanding of JPA EntityManager injection
Programming question:
Should we treat PersistenceContext, PersistenceUnit as kind of a BindingType?
I'm not sure about this. WDYT?
LieGrü,
strub
--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am Mo, 26.1.2009:
> Von: Gurkan Erdogdu <gu...@yahoo.com>
> Betreff: Re: AW: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 20:32
> You are right Mark. If EJB container is in the scenario, EJB
> container is responsible for handling these. If not, then
> the OWB will inject these.
>
> There is also new resource injection defined in chapter 3.6
>
> /Gurkan
>
>
>
>
> ________________________________
> From: Mark Struberg <st...@yahoo.de>
> To: openwebbeans-dev@incubator.apache.org
> Sent: Monday, January 26, 2009 7:11:31 PM
> Subject: AW: Basic understanding of JPA EntityManager
> injection
>
> Humm, maybe I thought to complex about this the first time
> and there are no interferences between PersistenceUnits in
> EJB managed beans and PersistenceUnits in WebBeans at all?
>
> If there aren't any, then we could simply reduce the
> logic to
>
> any @PersistenceContext,... in EJB will be injected by the
> EJB container
> any @PersistenceContext,... in WebBeans will be injected by
> OWB.
>
> since
> Persistence.createEntityManagerFactory("unitname")
> will in both cases return the same instance (hopefully also
> in more complex JNDI setups!)
>
> Any error in my reasoning?
>
> LieGrue,
> strub
>
> --- Mark Struberg <st...@yahoo.de> schrieb am Mo,
> 26.1.2009:
>
> > Von: Mark Struberg <st...@yahoo.de>
> > Betreff: AW: Basic understanding of JPA EntityManager
> injection
> > An: openwebbeans-dev@incubator.apache.org
> > Datum: Montag, 26. Januar 2009, 14:22
> > to be more specific: this is about how to implement
> the
> > section
> >
> > 3.10. Support for Common Annotations
> >
> > of the spec. My fear is that the EJB container and
> > OpenWebBeans interfere with each other in this domain.
> >
> > There is currently only the handling of @PostConstruct
> and
> > @PreDestroy implemented for beans under our control.
> >
> > LieGrue,
> > strub
> >
> >
> > --- Mark Struberg <st...@yahoo.de> schrieb am
> Mo,
> > 26.1.2009:
> >
> > > Von: Mark Struberg <st...@yahoo.de>
> > > Betreff: Basic understanding of JPA EntityManager
> > injection
> > > An: openwebbeans-dev@incubator.apache.org
> > > Datum: Montag, 26. Januar 2009, 12:56
> > > Hi!
> > >
> > > A little question about integrating handlers for
> a few
> > very
> > > specific situations:
> > >
> > > If we provide support for JPA, then the following
> > > annotations are often being used:
> > >
> > > javax.persistence.PersistenceContext
> > > javax.persistence.PersistenceContexts
> > > javax.persistence.PersistenceUnit
> > > javax.persistence.PersistenceUnits
> > >
> > > They are really very handy, even if NO EJB
> container
> > is
> > > involved.
> > >
> > > So my question is: do we like to support this
> > functionality
> > > in a standalone manner?
> > >
> > > In other words:
> > > if (!EJBContainer available) {
> > > inject PersistenceContext and PersistenceUnit
> > > }
> > >
> > > This is the way Spring works, and I personally
> find
> > this
> > > quite handy.
> > >
> > > We could easily implement this in an own optional
> > module.
> > >
> > > WDYT?
> > >
> > > LieGrue,
> > > strub
Re: AW: Basic understanding of JPA EntityManager injection
Posted by Mark Struberg <st...@yahoo.de>.
Programming question:
Should we treat PersistenceContext, PersistenceUnit as kind of a BindingType?
I'm not sure about this. WDYT?
LieGrü,
strub
--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am Mo, 26.1.2009:
> Von: Gurkan Erdogdu <gu...@yahoo.com>
> Betreff: Re: AW: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 20:32
> You are right Mark. If EJB container is in the scenario, EJB
> container is responsible for handling these. If not, then
> the OWB will inject these.
>
> There is also new resource injection defined in chapter 3.6
>
> /Gurkan
>
>
>
>
> ________________________________
> From: Mark Struberg <st...@yahoo.de>
> To: openwebbeans-dev@incubator.apache.org
> Sent: Monday, January 26, 2009 7:11:31 PM
> Subject: AW: Basic understanding of JPA EntityManager
> injection
>
> Humm, maybe I thought to complex about this the first time
> and there are no interferences between PersistenceUnits in
> EJB managed beans and PersistenceUnits in WebBeans at all?
>
> If there aren't any, then we could simply reduce the
> logic to
>
> any @PersistenceContext,... in EJB will be injected by the
> EJB container
> any @PersistenceContext,... in WebBeans will be injected by
> OWB.
>
> since
> Persistence.createEntityManagerFactory("unitname")
> will in both cases return the same instance (hopefully also
> in more complex JNDI setups!)
>
> Any error in my reasoning?
>
> LieGrue,
> strub
>
> --- Mark Struberg <st...@yahoo.de> schrieb am Mo,
> 26.1.2009:
>
> > Von: Mark Struberg <st...@yahoo.de>
> > Betreff: AW: Basic understanding of JPA EntityManager
> injection
> > An: openwebbeans-dev@incubator.apache.org
> > Datum: Montag, 26. Januar 2009, 14:22
> > to be more specific: this is about how to implement
> the
> > section
> >
> > 3.10. Support for Common Annotations
> >
> > of the spec. My fear is that the EJB container and
> > OpenWebBeans interfere with each other in this domain.
> >
> > There is currently only the handling of @PostConstruct
> and
> > @PreDestroy implemented for beans under our control.
> >
> > LieGrue,
> > strub
> >
> >
> > --- Mark Struberg <st...@yahoo.de> schrieb am
> Mo,
> > 26.1.2009:
> >
> > > Von: Mark Struberg <st...@yahoo.de>
> > > Betreff: Basic understanding of JPA EntityManager
> > injection
> > > An: openwebbeans-dev@incubator.apache.org
> > > Datum: Montag, 26. Januar 2009, 12:56
> > > Hi!
> > >
> > > A little question about integrating handlers for
> a few
> > very
> > > specific situations:
> > >
> > > If we provide support for JPA, then the following
> > > annotations are often being used:
> > >
> > > javax.persistence.PersistenceContext
> > > javax.persistence.PersistenceContexts
> > > javax.persistence.PersistenceUnit
> > > javax.persistence.PersistenceUnits
> > >
> > > They are really very handy, even if NO EJB
> container
> > is
> > > involved.
> > >
> > > So my question is: do we like to support this
> > functionality
> > > in a standalone manner?
> > >
> > > In other words:
> > > if (!EJBContainer available) {
> > > inject PersistenceContext and PersistenceUnit
> > > }
> > >
> > > This is the way Spring works, and I personally
> find
> > this
> > > quite handy.
> > >
> > > We could easily implement this in an own optional
> > module.
> > >
> > > WDYT?
> > >
> > > LieGrue,
> > > strub
Re: AW: Basic understanding of JPA EntityManager injection
Posted by Gurkan Erdogdu <gu...@yahoo.com>.
You are right Mark. If EJB container is in the scenario, EJB container is responsible for handling these. If not, then the OWB will inject these.
There is also new resource injection defined in chapter 3.6
/Gurkan
________________________________
From: Mark Struberg <st...@yahoo.de>
To: openwebbeans-dev@incubator.apache.org
Sent: Monday, January 26, 2009 7:11:31 PM
Subject: AW: Basic understanding of JPA EntityManager injection
Humm, maybe I thought to complex about this the first time and there are no interferences between PersistenceUnits in EJB managed beans and PersistenceUnits in WebBeans at all?
If there aren't any, then we could simply reduce the logic to
any @PersistenceContext,... in EJB will be injected by the EJB container
any @PersistenceContext,... in WebBeans will be injected by OWB.
since Persistence.createEntityManagerFactory("unitname")
will in both cases return the same instance (hopefully also in more complex JNDI setups!)
Any error in my reasoning?
LieGrue,
strub
--- Mark Struberg <st...@yahoo.de> schrieb am Mo, 26.1.2009:
> Von: Mark Struberg <st...@yahoo.de>
> Betreff: AW: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 14:22
> to be more specific: this is about how to implement the
> section
>
> 3.10. Support for Common Annotations
>
> of the spec. My fear is that the EJB container and
> OpenWebBeans interfere with each other in this domain.
>
> There is currently only the handling of @PostConstruct and
> @PreDestroy implemented for beans under our control.
>
> LieGrue,
> strub
>
>
> --- Mark Struberg <st...@yahoo.de> schrieb am Mo,
> 26.1.2009:
>
> > Von: Mark Struberg <st...@yahoo.de>
> > Betreff: Basic understanding of JPA EntityManager
> injection
> > An: openwebbeans-dev@incubator.apache.org
> > Datum: Montag, 26. Januar 2009, 12:56
> > Hi!
> >
> > A little question about integrating handlers for a few
> very
> > specific situations:
> >
> > If we provide support for JPA, then the following
> > annotations are often being used:
> >
> > javax.persistence.PersistenceContext
> > javax.persistence.PersistenceContexts
> > javax.persistence.PersistenceUnit
> > javax.persistence.PersistenceUnits
> >
> > They are really very handy, even if NO EJB container
> is
> > involved.
> >
> > So my question is: do we like to support this
> functionality
> > in a standalone manner?
> >
> > In other words:
> > if (!EJBContainer available) {
> > inject PersistenceContext and PersistenceUnit
> > }
> >
> > This is the way Spring works, and I personally find
> this
> > quite handy.
> >
> > We could easily implement this in an own optional
> module.
> >
> > WDYT?
> >
> > LieGrue,
> > strub
AW: Basic understanding of JPA EntityManager injection
Posted by Mark Struberg <st...@yahoo.de>.
Humm, maybe I thought to complex about this the first time and there are no interferences between PersistenceUnits in EJB managed beans and PersistenceUnits in WebBeans at all?
If there aren't any, then we could simply reduce the logic to
any @PersistenceContext,... in EJB will be injected by the EJB container
any @PersistenceContext,... in WebBeans will be injected by OWB.
since Persistence.createEntityManagerFactory("unitname")
will in both cases return the same instance (hopefully also in more complex JNDI setups!)
Any error in my reasoning?
LieGrue,
strub
--- Mark Struberg <st...@yahoo.de> schrieb am Mo, 26.1.2009:
> Von: Mark Struberg <st...@yahoo.de>
> Betreff: AW: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 14:22
> to be more specific: this is about how to implement the
> section
>
> 3.10. Support for Common Annotations
>
> of the spec. My fear is that the EJB container and
> OpenWebBeans interfere with each other in this domain.
>
> There is currently only the handling of @PostConstruct and
> @PreDestroy implemented for beans under our control.
>
> LieGrue,
> strub
>
>
> --- Mark Struberg <st...@yahoo.de> schrieb am Mo,
> 26.1.2009:
>
> > Von: Mark Struberg <st...@yahoo.de>
> > Betreff: Basic understanding of JPA EntityManager
> injection
> > An: openwebbeans-dev@incubator.apache.org
> > Datum: Montag, 26. Januar 2009, 12:56
> > Hi!
> >
> > A little question about integrating handlers for a few
> very
> > specific situations:
> >
> > If we provide support for JPA, then the following
> > annotations are often being used:
> >
> > javax.persistence.PersistenceContext
> > javax.persistence.PersistenceContexts
> > javax.persistence.PersistenceUnit
> > javax.persistence.PersistenceUnits
> >
> > They are really very handy, even if NO EJB container
> is
> > involved.
> >
> > So my question is: do we like to support this
> functionality
> > in a standalone manner?
> >
> > In other words:
> > if (!EJBContainer available) {
> > inject PersistenceContext and PersistenceUnit
> > }
> >
> > This is the way Spring works, and I personally find
> this
> > quite handy.
> >
> > We could easily implement this in an own optional
> module.
> >
> > WDYT?
> >
> > LieGrue,
> > strub
AW: Basic understanding of JPA EntityManager injection
Posted by Mark Struberg <st...@yahoo.de>.
to be more specific: this is about how to implement the section
3.10. Support for Common Annotations
of the spec. My fear is that the EJB container and OpenWebBeans interfere with each other in this domain.
There is currently only the handling of @PostConstruct and @PreDestroy implemented for beans under our control.
LieGrue,
strub
--- Mark Struberg <st...@yahoo.de> schrieb am Mo, 26.1.2009:
> Von: Mark Struberg <st...@yahoo.de>
> Betreff: Basic understanding of JPA EntityManager injection
> An: openwebbeans-dev@incubator.apache.org
> Datum: Montag, 26. Januar 2009, 12:56
> Hi!
>
> A little question about integrating handlers for a few very
> specific situations:
>
> If we provide support for JPA, then the following
> annotations are often being used:
>
> javax.persistence.PersistenceContext
> javax.persistence.PersistenceContexts
> javax.persistence.PersistenceUnit
> javax.persistence.PersistenceUnits
>
> They are really very handy, even if NO EJB container is
> involved.
>
> So my question is: do we like to support this functionality
> in a standalone manner?
>
> In other words:
> if (!EJBContainer available) {
> inject PersistenceContext and PersistenceUnit
> }
>
> This is the way Spring works, and I personally find this
> quite handy.
>
> We could easily implement this in an own optional module.
>
> WDYT?
>
> LieGrue,
> strub