openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1563) Better parameter validation on StoreCache.pinAll() method
Date Sat, 01 May 2010 17:02:57 GMT


Rick Curtis commented on OPENJPA-1563:

One thing I want to point out is that JPAFacadeHelper.toOpenJPAObjectId(..) will now throw
a RuntimeException. This could cause a behavior change for any users currently using the java.persistence.Cache
interface improperly. 

For example, if they call javax.persistence.Cache.evict(Class, oid) and oid isn't a valid
oid for the provided Class, we will now throw a UserException. 

> Better parameter validation on StoreCache.pinAll() method
> ---------------------------------------------------------
>                 Key: OPENJPA-1563
>                 URL:
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: datacache
>    Affects Versions: 2.0.0-beta2, 2.0.0
>            Reporter: Kevin Sutter
>            Assignee: Rick Curtis
>            Priority: Minor
>             Fix For: 2.1.0
> Validation of the second parameter on StoreCache.pinAll could be better.  Currently,
we assume that the list of oids provided are valid ids for the Class instances being cached.
 But, if the collection of Objects passed in are not actual ids, then we end up reserving
spots in the cache that never get utilized.
>     /**
>      * Pin the data for the given oids to the cache.
>      */
>     public void pinAll(Class cls, Object... oids);
> Since the Class type is also passed in, we should be able to validate that the oids passed
in are valid.  At a minimum, checking if they are oids in the first place would be a good
catch.  Currently, we do nothing.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message