You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Adam Hardy <ad...@cyberspaceroad.org> on 2008/03/02 16:03:52 UTC
Re: multiple persistence-units, each w different provider
"should" being the operative word here. Actually I tested out the Geronimo
package org.apache.geronimo.specs.geronimo-jpa_3.0_spec-1.1.1 and it solved the
problem for me. Thanks.
Kevin Sutter on 29/02/08 16:43, wrote:
> Right, and there should be no reason to develop your own version of the
> javax.persistence.Persistence. The one provided by Sun/Glassfish, Geronimo,
> etc should all provide the same level of functionality. (Albeit, as Pinaki
> has pointed out in a separate thread, not all of the fixes have made it into
> every version.)
>
> Kevin
>
> On Thu, Feb 28, 2008 at 6:41 PM, Patrick Linskey <pl...@gmail.com> wrote:
>
>> Hi,
>>
>> I think that the official copy is the one at Glassfish.
>>
>> -Patrick
>>
>> On Thu, Feb 28, 2008 at 2:15 AM, Adam Hardy <ad...@cyberspaceroad.org>
>> wrote:
>>> I have three persistence-unit nodes in my persistence.xml: one for
>> Toplink with
>>> the toplink provider specified, one for Hibernate, and one for OpenJPA.
>>>
>>> It tests various operations in JPA, configured to use whichever JPA
>> supplier I
>>> specify at the time, i.e. I just change the name of the
>> persistence-unit I pass
>>> to Persistence.createEntityManagerFactory().
>>>
>>> So I have, for instance at the moment, not only openjpa.jar on the
>> classpath,
>>> but also hibernate-entitymanager.jar and toplink-essentials.jar.
>>>
>>> When running my test, due to the way
>> javax.persistence.Persistence.class is
>>> programmed, any of those providers may be picked for use, without
>> reference to
>>> the name of the persistence-unit name that I specified when calling
>>> createEntityManagerFactory() - somewhat surprisingly!
>>>
>>> If my memory serves me well, the persistence-api.jar that I am using is
>> just the
>>> one that maven downloaded automatically from the global jar repo.
>>>
>>> I'm tempted to create my own javax.persistence.Persistence to do it
>> properly and
>>> position it ahead of the persistence-api.jar on my classpath.
>>>
>>> This just doesn't seem right. I guess I should be asking at Sun. Was it
>> Sun who
>>> wrote javax.persistence.Persistence ? Or are there different versions?
>> Is there
>>> an 'OpenJPA persistence-api'?
>>>
>>> Has anyone here written their own and made it publicly available?
>>>
>>>
>>> Thanks
>>> Adam
>>>
>>>
>>
>>
>> --
>> Patrick Linskey
>> 202 669 5907
>>
>