db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: JDO-58
Date Wed, 01 Jun 2005 12:40:19 GMT
Hi Craig,

> Hi Michelle,
> 
> We should look at the cases for pmf being null. The tearDown method 
> relies on the ability to get access to a PM in order to do cleanup. It 
> doesn't make sense to go through the expensive process of getting a PMF 
> if there is no tearDown work to do.
> 
> So perhaps we need to check first for any instances or classes to be 
> removed before we get a PMF in tearDown...
I agree!


> And we should probably disallow pmf == null in cases where there is work 
> to do.
I'm not sure. Do you mean that the test result is ERROR for test cases 
having "pmf == null in cases where there is work to do"? Let me know if 
you feel strong on this.

By then I'll prepare a patch that includes your issue above and the 
proposal below.

Regards,
Michael

> 
> Craig
> 
> On May 31, 2005, at 11:06 AM, Michelle Caisse wrote:
> 
>> Alternatively, getPMF() could check to see if pmf is closed or null 
>> and return a new pmf  in either case.
>>
>> -- Michelle
>>
>> Michael Watzek wrote:
>>
>>> Hi,
>>>
>>> there are 5 tests (AfterCloseGetPMThrowsException, 
>>> AfterCloseSetMethodsThrowException, Close, 
>>> CloseFailsIfTransactionActive, 
>>> CloseWithoutPermissionThrowsSecurityException) that call "getPMF()" 
>>> and "pmf.close()" in their "testXXX" methods , but they do not 
>>> nullify field "pmf". All of those tests fail in "localTearDown": 
>>> "localTearDown" calls "getPMF()" which returns field "pmf" if it is 
>>> not null. For this reason, "getPMF()" returnes a closed PMF in those 
>>> tests.
>>>
>>> The proposal for a fix is to add a check before "localTearDown" is 
>>> called:
>>>
>>> if (pmf!=null && pmf.isClosed())
>>>     pmf = null;
>>>
>>> Regards,
>>> Michael
>>
>>
>>
>>
> 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!


-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message