db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig Russell <Craig.Russ...@Sun.COM>
Subject Re: 4 non transactional read errors
Date Mon, 27 Jun 2005 17:27:37 GMT
Hi Michael,

On Jun 27, 2005, at 10:03 AM, Michael Watzek wrote:

> Hi Craig,
>
> there are two tests throwing a JDOUserException ("Can't read fields  
> with outside of transactions. You may want to set  
> 'NontransactionalRead=true'.").
>
> The first test ("Retrieve.runTestRetrieve") begins a transaction,  
> retrieves fields of a pc instance, commits, and calls a getter  
> method on that instance.
>
> The second test ("HollowInstanceMaintainsPK.test") begins a  
> transaction,  makes an object persistent, commits, and calls a  
> getter method on that object.

 From the sound of it, it is the PK that is being read. If this is  
the case, then no transaction is required. PK fields can always be  
read, even for deleted instances.
>
> Both tests seem to assume that non-transactional read is set.  
> Should we change the test cases and make the pc instances transient  
> before we call the getter?

No, nontransactional read is an optional feature, so we can't assume  
that it is supported. The correct fix is to start a transaction  
before reading the field, and commit the transaction after reading  
the field.
>
> Furthermore, we have two errors  
> ("org.jpox.exceptions.TransactionNotActiveException: Transaction is  
> not active..."). Both test cases  
> ("IteratorHasNextFalseAfterExtentClose", "Iterators") iterate an  
> extent outside of a transactions. I can fix this also.

Yes, please fix these.

Thanks,

Craig
>
> Regards,
> Michael
> -- 
> -------------------------------------------------------------------
> 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/
> -------------------------------------------------------------------
>

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