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 "Rick Hillegas (Commented) (JIRA)" <ji...@apache.org> on 2012/04/11 14:39:17 UTC

[jira] [Commented] (DERBY-5494) Same value returned by successive calls to a sequence generator flanking an unorderly shutdown.

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

Rick Hillegas commented on DERBY-5494:
--------------------------------------

Here is another view on the bug. In this view we add another connection which confirms that the original "next value for" statement durably commits a change to SYSSEQUENCES. But after the system crash, that supposedly durable change has rolled back.

1) Run this script. The select from the second thread shows that SYSSEQUENCES has changed:

connect 'jdbc:derby:db;create=true' as dbo;
create procedure systemExit( in exitCode int ) language java parameter style java no sql external name 'java.lang.System.exit';
create sequence s;

values next value for s;

connect 'jdbc:derby:db';
select currentvalue from sys.syssequences where sequencename='S';

set connection dbo;
call systemExit( 1 );

2) Now run this script. You will see that the change to SYSSEQUENCES has been rolled back:

connect 'jdbc:derby:db';
select currentvalue from sys.syssequences where sequencename='S';

                
> Same value returned by successive calls to a sequence generator flanking an unorderly shutdown.
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5494
>                 URL: https://issues.apache.org/jira/browse/DERBY-5494
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.6.1.0, 10.6.2.1, 10.7.1.1, 10.8.1.2, 10.8.2.2, 10.9.0.0
>            Reporter: Rick Hillegas
>              Labels: derby_triage10_9
>
> The following sequence of steps causes a sequence generator to return the same value on successive NEXT VALUE FOR calls.
> 1) Bring up ij and issue the following commands:
> connect 'jdbc:derby:db;create=true';
> create sequence s;
> values next value for s; 
> 2) Control-c out of ij so that the engine comes down hard without an orderly shutdown.
> 3) Now bring up ij again and issue the following commands:
> connect 'jdbc:derby:db';
> values next value for s; 
> Thanks to Knut for finding this one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira