I did not get this error without including MVCC=true. In this case I was
getting table locked exception, even though there was only a single thread
accessing the table. It appeared as though the table was not unlocked after
a rollback.

The issue I am seeing now is not on the primary key, only a unique index on
another column. The use case is a user cancelling an insert, which causes a
rollback. And then inserting the same value again, without cancelling. The
database is also empty of data at the point of the test.

I am using Hibernate 3.2.6 (also tested 3.5.0).

Here is the stack trace,

Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key
violation: "CONSTRAINT_INDEX_3 ON PUBLIC.FILEINFOENTITY(
SOURCEHASH)"; SQL statement:
insert into public.FileInfoEntity (id, lastMdfdTmst, extension,
lastModified, size, sourceHash, sourcePath, sourceTemplate, t
rack_id) values (null, ?, ?, ?, ?, ?, ?, ?, ?) [23001-125]
at org.h2.message.Message.getSQLException(Message.java:111)
at org.h2.message.Message.getSQLException(Message.java:122)
at org.h2.message.Message.getSQLException(Message.java:75)
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:159)
at org.h2.index.PageBtree.find(PageBtree.java:116)
at org.h2.index.PageBtreeLeaf.addRow(PageBtreeLeaf.java:139)
at org.h2.index.PageBtreeLeaf.addRowTry(PageBtreeLeaf.java:94)
at org.h2.index.PageBtreeIndex.addRow(PageBtreeIndex.java:87)
at org.h2.index.PageBtreeIndex.add(PageBtreeIndex.java:78)
at org.h2.index.MultiVersionIndex.add(MultiVersionIndex.java:50)
at org.h2.table.TableData.addRow(TableData.java:130)
at org.h2.command.dml.Insert.insertRows(Insert.java:119)
at org.h2.command.dml.Insert.update(Insert.java:82)
at org.h2.command.CommandContainer.update(CommandContainer.java:71)
at org.h2.command.Command.executeUpdate(Command.java:201)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
at
org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 53 more



On Sun, Dec 6, 2009 at 5:01 PM, Eric Faulhaber <e...@goldencode.com> wrote:

> A related question:  did the duplicate primary key after rollback bug
> occur in multi-threaded mode as well?
>
> If so, would this fix have eliminated the bug in that mode, too?
>
> Thanks,
> Eric
>
>
> tzman wrote:
> > Version 1.2.124 (2009-11-20)
> >
> > The  following is listed as a fix in Version 1.1.118 (2009-09-04)
> >
> > Issue 111: Multi-version concurrency / duplicate primary key after
> > rollback.
> >
> > I am having the same issue with unique contraints.
> >
> > Is this a known bug?
> >
> > Thanks
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to h2-datab...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database+unsubscr...@googlegroups.com<h2-database%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-datab...@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.


Reply via email to