-
1. Re: Might be something simple, JPA?
pmuir Apr 27, 2009 12:32 PM (in response to meetoblivion)You have two option's in the latest release. Simplest option is to use @PersistenceContext (anywhere, not just in EJBs). Another option is to use the Java EE Resource injection. Add to your beans.xml:
<EntityManager> <PersistenceContext> <unitName>CustomerDatabase</unitName> </PersistenceContext> <myapp:CustomerDatabase/> </EntityManager>
and inject as @CustomerDatabase EntityManager entityManager;
-
2. Re: Might be something simple, JPA?
gonorrhea Apr 28, 2009 10:47 PM (in response to meetoblivion)So will Web Beans offer the equivalent of SMPC or not? Or must we wait for Seam 3?
And what about using Hibernate MANUAL flush with SMPC? Will that be available in Web Beans or not?
-
3. Re: Might be something simple, JPA?
nickarls Apr 29, 2009 12:03 AM (in response to meetoblivion)Well, someone has to write it first, is there a difference if it's in Web Beans extension or Seam 3? ;-) Don't know how politically correct it would be to bundle something Hibernate-specific with Web Beans. Well, if it would be an extension, perhaps it wouldn't matter. But if we make all Seam 3 modules JSR-299 pluggable and bundle them with Web Beans as extensions, there is not much of Seam left :-)
-
4. Re: Might be something simple, JPA?
gonorrhea Apr 29, 2009 12:38 AM (in response to meetoblivion)It's possible to implement the spec (e.g. RI) and add extra functionality. That's what the major middleware vendors do with JEE 5, for example. Clustering is not part of the spec (AFAIK) but they add it on and it passes TCK...
Well the idea was to have Web Beans form the core of Seam 3. Ok, so what will happen to bijection in Seam 3, will it use Guice or not?
-
5. Re: Might be something simple, JPA?
pmuir May 7, 2009 11:10 AM (in response to meetoblivion)I don't understand what Guice has got to do with it?
Seam 3 will be based on the 299 contexts and dependency injection.
-
6. Re: Might be something simple, JPA?
gonorrhea May 7, 2009 5:40 PM (in response to meetoblivion)ok, so are you saying that Seam 3 will not provide bijection capability (i.e. injection only, no outjection/disinjection)?
-
7. Re: Might be something simple, JPA?
nickarls May 8, 2009 7:53 AM (in response to meetoblivion)
Arbi Sookazian wrote on May 07, 2009 17:40:
ok, so are you saying that Seam 3 will not provide bijection capability (i.e. injection only, no outjection/disinjection)?There are hidden ways but we won't tell anyone so they won't abuse it :-P
-
8. Re: Might be something simple, JPA?
gavin.king May 12, 2009 9:36 AM (in response to meetoblivion)In the next rev of the 299 spec, the way to declare an injectable persistence context is:
public class Anything { @Produces @PersistenceContext(unitName="MyDatabase") @MyDatabase EntityManager em; }
Then you can inject it with:
@MyDatabase EntityManager em;
The same pattern applies for all other EE resourcey type things.
I want Seam to support the following:
public class Anything { @Produces @ConversationScoped @PersistenceContext(unitName="MyDatabase", type=EXTENDED) @MyDatabase EntityManager em; }
To get a conversation-scoped PC. But I doubt this will make it into 299.
-
9. Re: Might be something simple, JPA?
meetoblivion May 13, 2009 2:43 AM (in response to meetoblivion)isn't the issue w/ that approach more about the requirements of EXTENDED rather than capabilities of 299? (you know, fix JPA..)
-
10. Re: Might be something simple, JPA?
nickarls May 13, 2009 8:07 AM (in response to meetoblivion)Nah, as I see it, JPA is fine. It provides and extended persistence context. It is up to other layers to determine the lifecycle as to how extended it is