You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig Russell <Cr...@Sun.COM> on 2005/05/23 19:20:44 UTC

Issue 117: regarding Apache JDO Issue JDO-46

This is issue 117.

Currently, the spec is inconsistent or unclear in the treatment of 
close after close in the cases of PM and PMF.

Unclear: The PMF section on close doesn't address close, but does 
specifically disallow getPersistenceManager and “set methods” and allow 
“other get methods”. Nothing is said about isClosed, close, add/remove 
instance lifecycle listener.

Inconsistent with PMF: The PM section on close says that after close 
completes, all methods except isClosed throw JDOFatalUserException.

Proposal:

Change PM to state: all methods except isClosed, close, and getPMF 
throw JDOFatalUserException.

Change PMF to state: all methods except isClosed, close, and getter 
methods throw JDOFatalUserException.

Craig

On May 23, 2005, at 1:31 AM, erik@jpox.org wrote:

> This is a JPOX bug. It's due to a close call to a closed PMF.
>
> Question: If the PMF is closed and the close is called, is this a nope 
> or
> JDOUserException?
>
> Quoting Michael Bouschen <mb...@spree.de>:
>
>> Hi Michelle,
>>
>> I added a comment to issue JDO-46 including the stacktrace of the
>> NullPointerException thrown by jpox 
>> AbstractPersistenceManagerFactory.close.
>>
>> Regards Michael
>>
>> --
>> Michael Bouschen		Tech@Spree Engineering GmbH
>> mailto:mbo.tech@spree.de	http://www.tech.spree.de/
>> Tel.:++49/30/235 520-33		Buelowstr. 66
>> Fax.:++49/30/2175 2012		D-10783 Berlin
>>
>>
>
>
>
>
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!

RE: Issue 117: regarding Apache JDO Issue JDO-46

Posted by er...@jpox.org.
On a similar issue, if we obtain a pmf instance though
JDOHelper.getPMF(properties), the PMF is frozen and does not permit any
setter call. We ought to permit calling
setConnectionFactory/setConnectionFactory2 which receives Object
arguments and not properties. Both calls should be allowed until the
first PM is obtained from the PMF instance.

Otherwise, the user must create the PMF though a concrete implementation
and not with the standard JDOHelper.

Erik Bengtson 

-----Original Message-----
From: Wes Biggs [mailto:wes@tralfamadore.com] 
Sent: Tuesday, May 24, 2005 3:29 AM
To: JDO Expert Group
Cc: jdo-dev@db.apache.org
Subject: Re: Issue 117: regarding Apache JDO Issue JDO-46

I'm not too keen on allowing close() to be called multiple times (on 
either PM or PMF), though it's clearly a NOP.  But if we're going to be 
consistent about throwing exceptions for untenable code paths, we ought 
to, er, be consistent. ;-)

I would also support (though it would be a change from JDO1) access to 
get/setUserObject() regardless of closed-ness.  A use case might be: 
associate some context object with a PM; release it into the wild; when 
it is closed and returned, perform some context-sensitive action.

Other than that looks good.

Wes

Craig Russell wrote:

> This is issue 117.
>
> Currently, the spec is inconsistent or unclear in the treatment of 
> close after close in the cases of PM and PMF.
>
> Unclear: The PMF section on close doesn't address close, but does 
> specifically disallow getPersistenceManager and "set methods" and 
> allow "other get methods". Nothing is said about isClosed, close, 
> add/remove instance lifecycle listener.
>
> Inconsistent with PMF: The PM section on close says that after close 
> completes, all methods except isClosed throw JDOFatalUserException.
>
> Proposal:
>
> Change PM to state: all methods except isClosed, close, and getPMF 
> throw JDOFatalUserException.
>
> Change PMF to state: all methods except isClosed, close, and getter 
> methods throw JDOFatalUserException.
>
> Craig
>
> On May 23, 2005, at 1:31 AM, erik@jpox.org wrote:
>
>> This is a JPOX bug. It's due to a close call to a closed PMF.
>>
>> Question: If the PMF is closed and the close is called, is this a 
>> nope or
>> JDOUserException?
>>
>> Quoting Michael Bouschen <mb...@spree.de>:
>>
>>> Hi Michelle,
>>>
>>> I added a comment to issue JDO-46 including the stacktrace of the
>>> NullPointerException thrown by jpox 
>>> AbstractPersistenceManagerFactory.close.
>>>
>>> Regards Michael
>>>
>>> -- 
>>> Michael Bouschen        Tech@Spree Engineering GmbH
>>> mailto:mbo.tech@spree.de    http://www.tech.spree.de/
>>> Tel.:++49/30/235 520-33        Buelowstr. 66
>>> Fax.:++49/30/2175 2012        D-10783 Berlin
>>>
>>>
>>
>>
>>
>>
> 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!
>



Re: Issue 117: regarding Apache JDO Issue JDO-46

Posted by Wes Biggs <we...@tralfamadore.com>.
I'm not too keen on allowing close() to be called multiple times (on 
either PM or PMF), though it's clearly a NOP.  But if we're going to be 
consistent about throwing exceptions for untenable code paths, we ought 
to, er, be consistent. ;-)

I would also support (though it would be a change from JDO1) access to 
get/setUserObject() regardless of closed-ness.  A use case might be: 
associate some context object with a PM; release it into the wild; when 
it is closed and returned, perform some context-sensitive action.

Other than that looks good.

Wes

Craig Russell wrote:

> This is issue 117.
>
> Currently, the spec is inconsistent or unclear in the treatment of 
> close after close in the cases of PM and PMF.
>
> Unclear: The PMF section on close doesn't address close, but does 
> specifically disallow getPersistenceManager and “set methods” and 
> allow “other get methods”. Nothing is said about isClosed, close, 
> add/remove instance lifecycle listener.
>
> Inconsistent with PMF: The PM section on close says that after close 
> completes, all methods except isClosed throw JDOFatalUserException.
>
> Proposal:
>
> Change PM to state: all methods except isClosed, close, and getPMF 
> throw JDOFatalUserException.
>
> Change PMF to state: all methods except isClosed, close, and getter 
> methods throw JDOFatalUserException.
>
> Craig
>
> On May 23, 2005, at 1:31 AM, erik@jpox.org wrote:
>
>> This is a JPOX bug. It's due to a close call to a closed PMF.
>>
>> Question: If the PMF is closed and the close is called, is this a 
>> nope or
>> JDOUserException?
>>
>> Quoting Michael Bouschen <mb...@spree.de>:
>>
>>> Hi Michelle,
>>>
>>> I added a comment to issue JDO-46 including the stacktrace of the
>>> NullPointerException thrown by jpox 
>>> AbstractPersistenceManagerFactory.close.
>>>
>>> Regards Michael
>>>
>>> -- 
>>> Michael Bouschen        Tech@Spree Engineering GmbH
>>> mailto:mbo.tech@spree.de    http://www.tech.spree.de/
>>> Tel.:++49/30/235 520-33        Buelowstr. 66
>>> Fax.:++49/30/2175 2012        D-10783 Berlin
>>>
>>>
>>
>>
>>
>>
> 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!
>