db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Newsham (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5237) interrupting thread performing "create table" doesn't cause SQLException with sql state "08000"
Date Tue, 17 May 2011 20:48:47 GMT

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

Jim Newsham commented on DERBY-5237:

I have attached a junit test suite named DerbyInterruptTest with three test cases:
- testInterrupt() demonstrates that the test scaffolding (threading and interrupting) works
- testInsertRecords() demonstrates expected behavior when interrupting a thread performing
sql "inserts"
- testCreateTable() demonstrates that interrupting a thread performing sql "create table"
does not behave as expected

Each of the test cases calls performAndInterrupt(), which spawns a background thread to perform
the actual database operation and a second thread to constantly interrupt the database operation
thread.  The database thread calls perform() to perform the actual database calls; perform()
catches SQLException and retries the operation if the cause of failure was interruption (specifically,
if sql state is "08000"), repeatedly until successful.  

The remainder of the code is uninteresting utility methods. :)

> interrupting thread performing "create table" doesn't cause SQLException with sql state
> -----------------------------------------------------------------------------------------------
>                 Key: DERBY-5237
>                 URL: https://issues.apache.org/jira/browse/DERBY-5237
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions:
>         Environment: Windows 7, JDK 1.6.0_25
>            Reporter: Jim Newsham
>         Attachments: DerbyInterruptTest.java
> We would like to take advantage of the recent Derby enhancement for handling thread interruption.
 http://db.apache.org/derby/docs/dev/devguide/devguide-single.html, section "Working with
database threads in an embedded environment" states that in the case of exception, the calling
code should receive a SQLException with code 08000.  In my testing, this appears to work for
sql "insert" statements, but not for sql "create table" statements.  This is an issue for
us since database tables are created dynamically over the course of the application's normal
> Junit test repro to follow.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message