db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew T. Adams" <matt...@matthewadams.org>
Subject RE: [jira] Commented: (JDO-496) Add just "name" property to PMF, in addition to "persistenceUnitName"
Date Wed, 11 Jul 2007 15:43:36 GMT
I think that you are correct, except that there is the intervening step of
trying to find the PMF class name via META-INF/services lookup.  I think
your last paragraph should read:

If there isn't a javax.jdo.PersistenceManagerFactoryClass property in the
Properties and no PMF class name is found in
META-INF/services/PersistenceManagerFactoryClass, then JDOHelper should call
javax.persistence.Persistence.createEntityManageFactory with the PUName as
the first parameter and the Properties instance as the second parameter, and
cast the result to PersistenceManagerFactory.

Do you agree?

-----Original Message-----
From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] 
Sent: Tuesday, July 10, 2007 3:52 PM
To: jdo-dev@db.apache.org
Subject: Re: [jira] Commented: (JDO-496) Add just "name" property to PMF, in
addition to "persistenceUnitName"

Hi Matthew,

I think I know where you got confused. Me too.

On Jul 10, 2007, at 3:29 PM, Matthew T. Adams wrote:

> I realized while continuing working on my changes that what I  
> described
> isn't quite right.
>
> So, I think the question becomes the following.  What does it mean  
> for a PMF
> configuration (in a java.util.Properties instance, some properties  
> file, or
> a META-INF/jdoconfig.xml) to have the persistenceUnitName property  
> set?

That is, you got a Properties instance containing the  
javax.jdo.PersistenceManagerFactoryClass property and PUName and now  
it's up to the PMF implementation class to figure out what to do with  
it.

What it should do is to use the JSR-220 defined technique to find its  
configuration information from persistence.xml.

If there isn't a javax.jdo.PersistenceManagerFactoryClass property in  
the Properties, then JDOHelper should call  
javax.persistence.Persistence.createEntityManageFactory with the  
PUName as the first parameter and the Properties instance as the  
second parameter, and cast the result to PersistenceManagerFactory.

Craig
>
> -matthew
>
>
> -----Original Message-----
> From: Matthew T. Adams [mailto:matthew.adams@xcalia.com]
> Sent: Tuesday, July 10, 2007 12:31 PM
> To: jdo-dev@db.apache.org
> Subject: RE: [jira] Commented: (JDO-496) Add just "name" property  
> to PMF, in
> addition to "persistenceUnitName"
>
> I started to work on this, but forgot the requirements.  Craig, can  
> you
> please reiterate them in email so that I can finish?
>
> Here's what I think they are:
>
> Two concepts:  JDO "named PMF" & JPA "persistence unit name"
>
> JDOHelper.getPersistenceManager(String name, ...) will:
> * attempt to look for name as a resource on the classpath  
> containing JDO
> properties;
> * if not found, look for a named PMF with value equal to that of  
> name (if
> name is the empty string or null, it's the anonymous PMF) in all
> META-INF/jdoconfig.xml resources on classpath;
> * if multiple found, throw;
> * if not found, see if persistenceUnitName property is set (that  
> is, not
> null or the empty string);
> * if persistenceUnitName is set, find EMF via  
> javax.persistence.Persistence
> & cast to PMF;
> * if persistenceUnitName property is not set (it's null or the empty
> string), throw (no such thing as anonymous persistence unit).
>
> Correct?
>
> -matthew
>
> -----Original Message-----
> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM]
> Sent: Tuesday, July 10, 2007 10:17 AM
> To: jdo-dev@db.apache.org
> Subject: Re: [jira] Commented: (JDO-496) Add just "name" property  
> to PMF, in
> addition to "persistenceUnitName"
>
> Just checking. Thanks.
>
> Craig
>
> On Jul 10, 2007, at 10:14 AM, Andy Jefferson (JIRA) wrote:
>
>>
>>     [ https://issues.apache.org/jira/browse/JDO-496?
>> page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
>> tabpanel#action_12511496 ]
>>
>> Andy Jefferson commented on JDO-496:
>> ------------------------------------
>>
>>> Are we ready for this?
>>
>> JPOX is ready and has been for a while. Does anyone else matter ? ;-)
>>
>>> Add just "name" property to PMF, in addition to  
>>> "persistenceUnitName"
>>> -------------------------------------------------------------------- 
>>> -
>>>
>>>                 Key: JDO-496
>>>                 URL: https://issues.apache.org/jira/browse/JDO-496
>>>             Project: JDO
>>>          Issue Type: Improvement
>>>          Components: api2, api2-legacy
>>>            Reporter: Matthew T. Adams
>>>            Assignee: Matthew T. Adams
>>>             Fix For: JDO 2 maintenance release 1
>>>
>>>
>>> Add a property called "name" to PMF and use it to find named PMFs
>>> via jdoconfig.xml lookup, and support property
>>> "persistenceUnitName" as another PMF property.  A named PMF may
>>> also contain a persistenceUnitName property, which is passed along
>>> to the PMF implementation.
>>> We need to clarify the desired behavior if no named PMF is found
>>> via the name property.
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>
> 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!
>
>

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!



Mime
View raw message