cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: UseSharedCache programatic override failure
Date Mon, 05 Mar 2007 11:15:38 GMT
Hi Bob,

 From a quick glance looks like a bug. Could you please open a bug  
report:

http://issues.apache.org/cayenne/

Andrus


On Mar 3, 2007, at 12:03 AM, bob wrote:

> Hi all
>
> Using Cayenne 1.2.2, jdk5.
>
> In the modeler under cache configuration the "use shared cache" is  
> disabled. This value I want to override programatically for example:
>
>   boolean useSharedCache = true;
>   DataContext context = DataContext.createDataContext(useSharedCache);
>   DataObjectUtils.objectForPK(context, Employee.class, 200);
>
> This throws a nullpointer. Stack trace below.
>
> Is this valid use of the API?
>
> If I enable the "use shared cache" in the modeler this works fine,  
> so its not a big issue.
>
>
> Stacktrace:
>
> Exception in thread "main" java.lang.NullPointerException
> org.objectstyle.cayenne.access.DataDomainQueryAction.interceptOIDQuery 
> (DataDomainQueryAction.java:166)
> org.objectstyle.cayenne.access.DataDomainQueryAction.execute 
> (DataDomainQueryAction.java:143)
> org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:766)
> org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery 
> (ObjectContextQueryAction.java:253)
> org.objectstyle.cayenne.access.DataContextQueryAction.execute 
> (DataContextQueryAction.java:90)
> org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java: 
> 1423)
> org.objectstyle.cayenne.access.DataContext.performQuery 
> (DataContext.java:1412)
> org.objectstyle.cayenne.DataObjectUtils.objectForQuery 
> (DataObjectUtils.java:290)
> org.objectstyle.cayenne.DataObjectUtils.objectForPK 
> (DataObjectUtils.java:276)
> org.objectstyle.cayenne.DataObjectUtils.objectForPK 
> (DataObjectUtils.java:167)
> test.CacheOverride.main(CacheOverride.java:20)
>
>
> regards
>
> bob


Mime
View raw message