• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ERXEnterpriseObjectCache<T> pre-loading cache causes exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERXEnterpriseObjectCache<T> pre-loading cache causes exception


  • Subject: ERXEnterpriseObjectCache<T> pre-loading cache causes exception
  • From: JR Ruggentaler <email@hidden>
  • Date: Tue, 05 Feb 2013 18:57:41 +0000
  • Thread-topic: ERXEnterpriseObjectCache<T> pre-loading cache causes exception

I added a ERXEnterpriseObjectCache to my entity and when some of my old code tries to query the database instead of using the cache EOF throws the following exception. If I defer loading the cache (shouldFetchInitialValues=false) everything works. Is this a Wonder, EOF,… bug?

[2013-02-04 15:41:16,593] <performWork> ERROR Exception: java.lang.NullPointerException - null
NullPointerException
at com.webobjects.eoaccess.EODatabaseContext._objectFaultWithSnapshotRelationshipEditingContext(EODatabaseContext.java:2356)
... skipped 2 stack elements
at com.webobjects.eocontrol.EOObjectStoreCoordinator.initializeObject(EOObjectStoreCoordinator.java:597)
at com.webobjects.eocontrol.EOEditingContext.initializeObject(EOEditingContext.java:3768)
at er.extensions.eof.ERXEC.initializeObject(ERXEC.java:1141)
... skipped 3 stack elements
at com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpecification(EOObjectStoreCoordinator.java:488)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4069)
at er.extensions.eof.ERXEC.objectsWithFetchSpecification(ERXEC.java:1206)
at com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification(EOEditingContext.java:4444)
at com.mpv.mapload.Handler.loadingContextWillLoadObject(Handler.java:312)
at com.mpv.mapload.LoadingContext.willLoadObject(LoadingContext.java:930)
at com.mpv.mapload.LoadingContext.load(LoadingContext.java:737)
at com.mpv.agent.loaderagent.LoaderAgent.performWork(LoaderAgent.java:154)
at com.mpv.agent.MPVAgent._performWork(MPVAgent.java:310)
at com.mpv.agent.MPVAgent$MPVAgentTask._run(MPVAgent.java:198)
at er.extensions.concurrency.ERXTimerTask.run(ERXTimerTask.java:25)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

Here is the code that adds the cache to the entity.

public static class Util<T extends UserGroup> extends _UserGroup.Util<T> {

/** 

* UserGroup are static and stored in a lookup table. We use a cache

* to provide quick access to them. The cache is keyed by the userGroupID

* property.

*/

ERXEnterpriseObjectCache<T> _userGroupIDCache = new ERXEnterpriseObjectCache<T>(

UserGroup.ENTITY_NAME, UserGroup.USER_GROUP_ID_KEY);


/**

* Returns the UserGroup instance whose userGroupID property is equal to <code>value</code>.

* The UserGroup is localized into the provided editing context.

* 

* @param ec

* editing context in which the returned UserGroup instance is to live

* @param value

* UserGroup that is sought

* @return the UserGroup instance whose userGroupID property matches <code>userGroupID</code>

*/

public T findUserGroupForUserGroupID(EOEditingContext ec, Integer value) {

return _userGroupIDCache.objectForKey(ec, value);

}

}


JR

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERXEnterpriseObjectCache<T> pre-loading cache causes exception
      • From: Chuck Hill <email@hidden>
References: 
 >Re: WOCommunity Association is now a non-profit corporation (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: WOCommunity Association is now a non-profit corporation
  • Next by Date: Re: ERXEnterpriseObjectCache<T> pre-loading cache causes exception
  • Previous by thread: Re: WOCommunity Association is now a non-profit corporation
  • Next by thread: Re: ERXEnterpriseObjectCache<T> pre-loading cache causes exception
  • Index(es):
    • Date
    • Thread