db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Rename property PersistenceUnitName to Name
Date Wed, 06 Jun 2007 21:09:19 GMT
Hi Andy,

Thanks for raising these questions.

On Jun 5, 2007, at 11:12 PM, Andy Jefferson wrote:

> On 6 June  2007 07:04, Andy Jefferson wrote:
>>> I now believe that the "PersistenceUnit" part of the property  
>>> name is
>>> distracting, and the real property name should be simply "Name".  
>>> That
>>> is, PersistenceManagerFactories can have a Name property. The  
>>> javadoc
>>> and other documentation can call out that this name is the same as
>>> the PersistenceUnit name in JPA, but I don't think that there is
>>> value in calling it PersistenceUnitName.

For the purpose of the user asking for a specific PMF in the  
getPersistenceManagerFactory(String name), the Name property in PMF  
is sufficient. This is the usage that I was focusing on.
>> So now we would only have the "named PMF" specified via a PMF  
>> property to
>> support and implementations wouldn't be required to support  
>> reading of JPA
>> "persistence.xml" ?
>> I thought the general idea was to have more read-across between  
>> JPA and JDO
>> - ok having a "named PMF" does have its equivalent in JPA clearly,  
>> but
>> users can't then just take an existing "persistence.xml" file and a
>> <persistence-unit> contained within it and use it under JDO. Or  
>> maybe I
>> misunderstand your proposal

This part of the use case was not in mind when I wrote the change  
request. The user asks for PMF by name "MyPMF" but then the  
PersistenceUnitName in MyPMF refers to a PersistenceUnit in the  

Is that what JPOX does with the PersistenceUnitName today?
> Or maybe you intend that an implementation supports both, and that  
> the same
> name is used for both. But in that case how does the implementation  
> know
> which it should go for ? What if a named PMF *and* a named  
> "persistence-unit"
> exists for the supplied name - does "jdo.xml" take precedence over
> "persistence.xml", or vice-versa?

Good question. Perhaps there is room for both PersistenceUnitName and  
Name properties? The Name is used to match the user's  
getPersistenceManagerFactory(String name) and the PersistenceUnitName  
is used to match the persistence-unit name attribute in persistence.xml?

> -- 
> Andy  (Java Persistent Objects - http://www.jpox.org)

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!

View raw message