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 "Kathey Marsden (JIRA)" <ji...@apache.org> on 2008/12/12 22:54:44 UTC
[jira] Issue Comment Edited: (DERBY-3980) Conflicting select then
update with REPEATABLE_READ gives lock timeout instead of deadlock
[ https://issues.apache.org/jira/browse/DERBY-3980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656157#action_12656157 ]
kmarsden edited comment on DERBY-3980 at 12/12/08 1:52 PM:
-----------------------------------------------------------------
Thanks Mike for the tips and recommending tests. I am studying the code but must admit I am still a bit baffled by it all.
I do think I can help by writing regression tests, so we can feel confident in the fix when we get one. I'll write one for the simple deadlock case that I know works and I'd like to write a test for the live lock scenario. Do I just need three threads, 2 doing a repeated staggered select and another trying to get in and do an update?
Are there any other tests that would be good?
Thanks
Kathey
was (Author: kmarsden):
Thanks Mike for the tips and recommending tests. I am studying the code but must admit I am still a bit baffled by it all.
I do think I can help by writing regression tests, so we can feel confident in the fix when we get one. I'll write one for the simple deadlock case that I know works and I'd like to write a test for the live lock scenario. Do I just need two threads, 1 doing a repeated select and another trying to get in and do an update?
Are there any other tests that would be good?
Thanks
Kathey
> Conflicting select then update with REPEATABLE_READ gives lock timeout instead of deadlock
> ------------------------------------------------------------------------------------------
>
> Key: DERBY-3980
> URL: https://issues.apache.org/jira/browse/DERBY-3980
> Project: Derby
> Issue Type: Bug
> Components: Store
> Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kathey Marsden
> Attachments: derby-3980_javadoc_and_test_diff.txt, derby.log, derby.log.10_1, javacore.20081209.092827.9800.txt, TryTimeout.java, TryTimeout2.java, TryTimeout2.out.10_1.deadlock, TryTimeout2.out.10_1.deadlock, TryTimeout2.out.10_1.locktimeout, TryTimeout2.out.10_1.locktimeout
>
>
> The attached program TryTimeout.java should detect a deadlock but instead throws a lock timeout exception. The program has two threads that attempt:
>
> threadConnection.setAutoCommit(false);
> /* set isolation level to repeatable read */
> threadConnection.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
>
> ResultSet rs = stmt.executeQuery("select * from t where i = 456");
> while (rs.next());
> stmt.executeUpdate("update t set i = 456 where i = 456");
> threadConnection.commit();
> This gives SQLState 40001 (deadlock) with DB2 but a lock timeout with Derby.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.