openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <>
Subject Re: OWB with Seam?
Date Tue, 28 Jun 2011 22:04:21 GMT
Of course this might be an error in OWB.
But I generally question the reason why one would like to create a EntityManager for a PersistenceUnit
with no name. That would not allow you to use this mechanism in a bit more complex scenarios...


--- On Tue, 6/28/11, Thomas Andraschko <> wrote:

From: Thomas Andraschko <>
Subject: Re: OWB with Seam?
Date: Tuesday, June 28, 2011, 10:01 PM

AFAICS Seam adds the bean for the EntityManager in: org.jboss.seam.persistence.ManagedPersistenceContextExtension.registerManagedPersistenceContext
/ afterBeanDiscovery
This bean is also added with OWB but why it will not be injected?

--- Thomas Andraschko <> schrieb am Di, 28.6.2011:

Von: Thomas Andraschko <>
Betreff: Re: OWB with Seam?
Datum: Dienstag, 28. Juni, 2011 23:10 Uhr

Don't know how seam produces the EntityManager but the configuration is correct.
You can read about it here:

--- Eric Covener <> schrieb am Di, 28.6.2011:

Von: Eric Covener <>
Betreff: Re: OWB with Seam?
Datum: Dienstag, 28. Juni, 2011 22:49 Uhr

On Tue, Jun 28, 2011 at 4:30 PM, Thomas Andraschko
<> wrote:
> As you can see in the project uploaded at megaupload (it is linked in one of
 the older posts) the entitymanager is produced through seam with following producer field
in my application:
> public class MyEntityManagerProducer {
>     @ExtensionManaged
>     @Produces
>     @PersistenceUnit
>     @ConversationScoped
>     EntityManagerFactory myEntityManagerFactory;
> }

I don't know anything about JPA, but this field produces a
EntityManagerFactory while you inject an EntityManager.  You'd need to
either uses a producer method that invokes the factory, or inject the
factory and then invoke it.

View raw message