[
https://issues.apache.org/jira/browse/DERBY-3343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562396#action_12562396
]
Knut Anders Hatlen commented on DERBY-3343:
-------------------------------------------
Looks good to me. Two nits:
1) There's a mismatch between the parameter name and the @param tag in
testGeneratedIdentity() (generateType vs generatedType)
2) I think it's best not to have cleanup code inside the test cases, like the
try/finally block in testGeneratedIdentity(), since it tends to obscure
failures. Since the test is already wrapped in a CleanDatabaseTestSetup,
perhaps you could just make sure each invocation of the method uses a unique
table name and rely on the decorator to do the cleanup.
> Subsequent calls to PreparedStatement cause
> SQLIntegrityConstraintViolationException on column that is "Generated always"
> --------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3343
> URL: https://issues.apache.org/jira/browse/DERBY-3343
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.3.2.1
> Environment: gentoo linux amd64
> Reporter: William Becker
> Assignee: Dyre Tjeldvoll
> Attachments: d3343.diff, d3343.v2.diff, defaults.sql
>
>
> The following series of statements fails:
> j> connect 'jdbc:derby:test;create=true';
> ij> create table t (id int primary key generated always as identity);
> 0 rows inserted/updated/deleted
> ij> prepare p as 'insert into t(id) values (default)';
> ij> execute p;
> 1 row inserted/updated/deleted
> ij> execute p;
> ERROR 23505: The statement was aborted because it would have caused a
> duplicate key value in a unique or primary key constraint or unique index
> identified by 'SQL080123140906700' defined on 'T'.
> There is a more detailed discussion about it here:
> http://www.nabble.com/Generate-Always-and-SQLIntegrityConstraintViolationException-td15012038.html#a15018054
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.