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 Issue 147: Unique deletion by query
Date Fri, 25 Nov 2005 20:52:37 GMT
Hi Michael,

I'd expect a JDOUserException to be thrown.

The spec says

<spec 14.6.11>
void setUnique(boolean unique);
A14.6.11-1 [When the value of the Unique flag is true, then the  
result of a query is a single value, with null used to indicate that  
none of the instances in the candidates satisfied the filter. If more  
than one instance satisfies the filter, and the range is not limited  
to one result, then execute throws a JDOUserException.]
</spec 14.6.11>

I can add a similar description to the deletePersistentAll methods.  
It might require the JDOUserException to be thrown before actually  
deleting anything (the semantics of the method are such that a select  
needs to be executed against the datastore anyway before the delete  

Another alternative is to disallow the Unique flag for  
deletePersistentAll. But that's not what I would choose.


On Nov 25, 2005, at 6:07 AM, Michael Watzek wrote:

> Hi,
> I have a question concerning unique deletion by query:
> Assuming a unique JDO query would throw a JDOUserException in  
> execute() because the result is not unique, would you expect a  
> JDOUserException thrown in deletePersistentAll()?
> The spec does not require this and I'm not sure if we should add a  
> negative test case checking this.
> 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!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message