Thanks Mike. Ricardo
On Oct 6, 2012, at 8:12 AM, Mike Schrag <msch...@pobox.com> wrote: > There is no api exposed to cancel fetches in EOF … you'd need to do this with > JDBC. Also, never use Thread.stop because it can leave your thread in a > totally unknown state. You could use Thread.interrupt, but it will probably > have similar behavior to what you are seeing with stop (that is, interrupting > the IO rather than the query itself). > > ms > > On Oct 6, 2012, at 3:53 AM, Ricardo Parada <rpar...@mac.com> wrote: > >> Hi All, >> >> Does EOF have a way to interrupt the thread when it is blocked waiting on >> the results of evaluateExpression()? >> >> In JDBC if I have the following code: >> >> ResultSet rs = statement.executeQuery(sql); >> >> and the thread blocks in the executeQuery() waiting for the results then I >> can have a watch dog thread that I spawned previously with access to the >> statement and if the elapsed time exceeds a threshold I have the watch dog >> thread do a statement.cancel() which causes the thread blocked in the >> executeQuery() to throw a SQLException immediately. So I can use this >> mechanism to interrupt the query. >> >> Is there something similar in EOF? IF EOF allowed access to the underlying >> jdbc Statement being executed I'm sure it would be possible. I see that >> JDBCChannel has a _statement i-var which holds the Statement object but it >> is not a public i-var. Something like a cancel() in the EOAdaptorChannel >> which called the cancel() in super class (JDBCChannel) which would then call >> the cancel() to the _statement. That would be great. But I don't see such >> a thing. EOAdaptorChannel has cancelFetch() but nowhere does it do a >> _statement.cancel(). >> >> Any ideas? If there is no way then my workaround would be to use EOF to >> build the SQL from my qualifiers, etc. and then use JDBC's executeQuery() to >> process it. It should not be that bad as I only fetch a single attribute. >> But the FROM and WHERE clause is where it gets hairy and why I want to use >> EOF. It can go so hairy that this is the reason why I want to be able to >> interrupt it. >> >> I tried using Thread's stop(t) on the thread blocked on evaluateExpression() >> but it does not return right away. It appears that it interrupts the thread >> until the database server starts sending the results and about to start the >> fetching. >> >> Let me know please if anyone has any ideas. >> >> Thanks, >> Ricardo >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/webobjects-dev/mschrag%40pobox.com >> >> This email sent to msch...@pobox.com >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com