Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interrupting a fetch that is taking too long



On May 15, 2007, at 12:04 PM, John Huss wrote:

Actually terminating a query in progress is database-specific, so
there is no EOF way to do it.

EOAdaptor's cancelFetch() should do what the method name implies. Each database plugin includes an EOAdaptor subclass that overrides cancelFetch() to do the database-specific mojo necessary to cancel a fetch in progress.


You'd probably need to write your own fetchRow() loop checking at each iteration whether to cancel the fetch. But doing so isn't as easy in a WO app with its very long event loop compared with the desktop environment with its short event loop. Maybe you could have a timer running in one thread set a "cancelFetch" variable to true while the fetch loop in a different thread could check the value of "cancelFetch" during each iteration. But then you'd need to turn this array of fetched dictionaries into EO's in an editing context in the same way as using an editing context to fetch which isn't something that I'd like to mimic.

Aloha,
Art

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

This email sent to email@hidden
References: 
 >Interrupting a fetch that is taking too long (From: Ricardo Parada <email@hidden>)
 >Re: Interrupting a fetch that is taking too long (From: Kieran Kelleher <email@hidden>)
 >Re: Interrupting a fetch that is taking too long (From: "John Huss" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.