Programmatically overriding "use share cache" fails
---------------------------------------------------
Key: CAY-765
URL: https://issues.apache.org/cayenne/browse/CAY-765
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 1.2 [STABLE]
Reporter: bob schellink
Assigned To: Andrus Adamchik
Priority: Minor
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
at org.objectstyle.cayenne.access.DataDomainQueryAction.interceptOIDQuery(DataDomainQueryAction.java:166)
at org.objectstyle.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:143)
at org.objectstyle.cayenne.access.DataDomain.onQuery(DataDomain.java:766)
at org.objectstyle.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:253)
at org.objectstyle.cayenne.access.DataContextQueryAction.execute(DataContextQueryAction.java:90)
at org.objectstyle.cayenne.access.DataContext.onQuery(DataContext.java:1423)
at org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1412)
at org.objectstyle.cayenne.DataObjectUtils.objectForQuery(DataObjectUtils.java:290)
at org.objectstyle.cayenne.DataObjectUtils.objectForPK(DataObjectUtils.java:276)
at org.objectstyle.cayenne.DataObjectUtils.objectForPK(DataObjectUtils.java:167)
at test.CacheOverride.main(CacheOverride.java:20)
regards
bob
-- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
This archive was generated by hypermail 2.0.0 : Mon Mar 05 2007 - 06:57:23 EST