aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Mahrwald <>
Subject Re: JPA & WAB question
Date Wed, 28 Apr 2010 09:18:06 GMT
Hi Jarek, Tim,

with the release nearly out of the door (I hope saying this does not  
incur any bad luck) it sounds to me like a good time to start looking  
into the JPA & WAB issue that was left in a bit of a sway.

As mentioned by Tim scanning wabs for persistence.xml resources is  
only a small bit of what needs to happen to make JPA work properly for  
WABs. All of the support, say for annotation parsing, injecting JPA  
resources in the servlets currently resides in the webcontainer  
(Geronimo or otherwise). Seeing that what would be the level at which  
the Geronimo webcontainer wants to reuse the Apache Aries JPA code?

 From an orthogonality point of view, it would be nice IMHO if the  
webcontainer were to look up required JPA resources (EntityManagers  
and EntityManagerFactories) from the service registry and deals with  
the servlet injection part, whereas the Apache Aries container would  
deal with scanning persistence descriptors and creating the JPA  
resources? Does that sound feasible / desirable?



On 1 Apr 2010, at 03:12, Timothy Ward wrote:

> Hi Jarek,
> I completely agree that this is something we want the Aries JPA  
> container to cover, but there are a number of issues when  
> considering WABs as persistence bundles. WABs are simply a special  
> type of WAR file, and WAR files already have well defined behaviour  
> when interacting with a JPA container. This behaviour includes  
> injection of JPA resources into servlets, and scanning of particular  
> locations for persistence descriptors. These behaviours are not  
> described in an OSGi environment, and do not directly map to the JPA  
> service specification. For example should a WAB have to specify a  
> Meta-Persitence header to be scanned or should it follow a Java EE  
> style extension policy?
> I wanted to leave these decisions until after the OSGi Enterprise  
> Specification release (which was last week) so these issues could be  
> discussed on the list. I will be intermittently available until  
> April 21st, so I propose postponing further implementation  
> discussion until then.
> To further clarify, I absolutely agree with the Geronimo use case,  
> and it has always been my intention for that to be a first-class  
> mechanism for using managed JPA in OSGi. I simply thought that it  
> would be better to get the "simple" situations into the first  
> release without tying our hands for the more difficult Java EE cases.
> Regards,
> Tim
>> Date: Mon, 29 Mar 2010 23:56:03 -0400
>> Subject: Re: JPA & WAB question
>> From:
>> To:
>> Valentin, Tim,
>> So because there is no integration for web container, the JPA  
>> extender
>> is ignoring the WABs? If so, that seems weird. Just because there is
>> no integration, JPA shouldn't ignore the bundles. We might provide
>> that integration in Geronimo but we need the JPA extender to process
>> the persistence.xml resources. Unless of course I'm still missing or
>> misunderstanding something.
>> Jarek
>> On Mon, Mar 29, 2010 at 10:09 AM, Timothy Ward < 
>> > wrote:
>>> Hi Jarek,
>>> The JPA service specification does not cover any form of managed  
>>> JPA. The Aries JPA code is not an implementation of the JPA  
>>> service specification, but attempts to use concepts defined by  
>>> that specification to provide managed JPA in an OSGi environment.  
>>> This should hopefully feed back into future versions of the OSGi  
>>> service specification.
>>> Currently, as Valentin points out, there is no integration  
>>> mechanism that we can use to plug the Aries JPA container into a  
>>> web container to provide injection into servlets. We felt it safer  
>>> to temporarily disable WAB persistence units in the Aries  
>>> container until such support was available. We also need to  
>>> consider the case where the web container already has JEE style  
>>> support for WAR persistence units.
>>> I hope to be able to write a plugin for the Pax webcontainer to  
>>> demonstrate how integration can be supported through the existing  
>>> injection plugin (used by the blueprint integration layer). This  
>>> should not be a difficult task, and I would hope that porting the  
>>> code to other web containers is trivial. Once this support is  
>>> present I would have no issue with removing the restriction in the  
>>> Aries JPA container.
>>> I too would like to hear your use case, as it should be useful in  
>>> driving further implementation of the JPA web container integration.
>>> Regards,
>>> Tim
>>> ----------------------------------------
>>>> From:
>>>> To:
>>>> Subject: Re: JPA & WAB question
>>>> Date: Fri, 26 Mar 2010 07:05:34 +0000
>>>> Hi Jarek,
>>>> that is correct, the OSGi JPA spec is agnostic of web bundles
>>>> altogether.
>>>> Now, in a servlet 2.5 webcontainer there are certain assumptions a
>>>> developer can make about how JPA works, including say injecting
>>>> persistence contexts. These we cannot satisfy from the Aries JPA
>>>> container. Instead this kind of support needs to be provided  
>>>> chiefly
>>>> by the webcontainer. Hence, as an initial starting point Tim and I
>>>> have decided to explicitly exclude WABs from being handled by our  
>>>> JPA
>>>> container. (Maybe the message should read "JPA support for WABs  
>>>> is not
>>>> covered by the OSGi JPA specification" to be clearer?)
>>>> The plan is then hopefully to reuse bits of our JPA container
>>>> implementation to facilitate adding JPA functionality to any given
>>>> OSGi webcontainer. Have you got a use case in mind for Geronimo?
>>>> Regards,
>>>> Valentin
>>>> On 26 Mar 2010, at 04:50, Jarek Gawor wrote:
>>>>> Hi,
>>>>> The Aries OSGi JPA implementation claims that "WABs that use JPA  
>>>>> are
>>>>> not supported as part of the OSGi JPA specification". I can't  
>>>>> find any
>>>>> such text in the OSGi JPA spec. Does anybody know where that's
>>>>> described or why that is?
>>>>> Thanks,
>>>>> Jarek
>>> _________________________________________________________________
>>> Tell us your greatest, weirdest and funniest Hotmail stories
> _________________________________________________________________
> Send us your Hotmail stories and be featured in our newsletter

View raw message