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 |