You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Liam Sharp (JIRA)" <ji...@apache.org> on 2015/03/24 15:35:52 UTC

[jira] [Commented] (DERBY-3908) Add a mechanism for cancelling runaway transactions.

    [ https://issues.apache.org/jira/browse/DERBY-3908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14377958#comment-14377958 ] 

Liam Sharp commented on DERBY-3908:
-----------------------------------

Currently cancel() throws a java.sql.SQLFeatureNotSupportedException: Feature not implemented: cancel.

Would a quick win for embed mode implementation be:

{code}
final EmbedConnection conn = (EmbedConnection)statement.getConnection();
conn.cancelRunningStatement();
{code}

This is what we've implemented in our project to work round the lack of cancel.

I was quite surprised to see that Derby doesn't implement cancel. Here is our reason for needing it: We're using derby as the data source to a large scrolling table. We only page in a small section of the data (using offset/limit) based on the rows the user is viewing. If they scroll around quickly we cancel existing statements so we can load the new section quicker.



> Add a mechanism for cancelling runaway transactions.
> ----------------------------------------------------
>
>                 Key: DERBY-3908
>                 URL: https://issues.apache.org/jira/browse/DERBY-3908
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Rick Hillegas
>              Labels: derby_triage10_10
>
> We should add a mechanism by which the DBA can cancel a runaway transaction. Perhaps we could implement this as a new system procedure. This issue comes up on the user list frequently. For instance, see this thread: http://www.nabble.com/cancel-a-running-query--td19903183.html#a19903183 On the implementation side, Knut points out that EmbedConnection.cancelRunningStatement() might be a useful place to start.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)