Fix of “Unique index or primary key violation” in H2 1.3 branch

216 views
Skip to first unread message

Alexander Lauper

unread,
Nov 3, 2015, 11:32:07 PM11/3/15
to H2 Database
Thomas,

In 1.4.179 the following issue had been fixed:
  • Databases created with version 1.3.175 and earlier that contained foreign keys in combination with multi-column indexes could not be opened in some cases. This was due to a bugfix in version 1.3.176: Referential integrity constraints sometimes used the wrong index.
Will there be a release on the 1.3 branch which will address this issue? If not, when approximately will a stable 1.4 version be released?

Thanks and kind regards,
Alex

Noel Grandin

unread,
Nov 4, 2015, 1:23:17 AM11/4/15
to h2-da...@googlegroups.com
Just use 1.4 and pass in MV_STORE=false on your URL to use the old(1.3) storage engine.

Alexander Lauper

unread,
Nov 4, 2015, 5:14:28 AM11/4/15
to H2 Database
Is 1.4 stable enough for productive use?

Noel Grandin

unread,
Nov 4, 2015, 5:31:59 AM11/4/15
to h2-da...@googlegroups.com
If you're using the original storage engine, then yes.

(Although we're running with the MVStore engine in production and we've been fine, but I wouldn't recommend it for
production use without significant testing)

Alexander Lauper

unread,
Nov 4, 2015, 6:04:14 AM11/4/15
to H2 Database
ok, I will switch to 1.4 using the original storage engine.
thanks Noel

Thomas Mueller

unread,
Nov 4, 2015, 7:44:43 PM11/4/15
to h2-da...@googlegroups.com
Hi,

It is true, the PageStore engine is probably more stable, as it is available since a very long time now.

However, I think the MVStore engine also ready for production now. No serious issues have been reported since quite a long time now. I think I will mark the next version of H2 (using the MVStore engine as the default) as stable, unless somebody objects.

Regards,
Thomas


On Wednesday, November 4, 2015, Alexander Lauper <laup...@gmail.com> wrote:
ok, I will switch to 1.4 using the original storage engine.
thanks Noel

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Joonas Pulakka

unread,
Nov 6, 2015, 5:35:42 AM11/6/15
to H2 Database
There is an open issue about shutdown defrag corrupting db, https://github.com/h2database/h2database/issues/187 . I've had similar issue with non-split 1.4.190 DB. In my case the issue was, when opening DB that was shut down with shutdown defrag,

Caused by: java.lang.ClassCastException: org.h2.value.ValueLong cannot be cast to java.lang.Long
	at org.h2.store.LobStorageMap.init(LobStorageMap.java:128)
	at org.h2.engine.Database.open(Database.java:767)
	at org.h2.engine.Database.openDatabase(Database.java:269)

Sorry, I couldn't come up with a nice isolated test case (yet). It happens in rather complex testing scenario where the DB gets re-opened very soon - possibly concurrently with an ongoing shutdown defrag, but H2 locks should take care of that, right?

Best Regards,
Joonas


torstai 5. marraskuuta 2015 2.44.43 UTC+2 Thomas Mueller kirjoitti:
Hi,

It is true, the PageStore engine is probably more stable, as it is available since a very long time now.

However, I think the MVStore engine also ready for production now. No serious issues have been reported since quite a long time now. I think I will mark the next version of H2 (using the MVStore engine as the default) as stable, unless somebody objects.

Regards,
Thomas


On Wednesday, November 4, 2015, Alexander Lauper <laup...@gmail.com> wrote:
ok, I will switch to 1.4 using the original storage engine.
thanks Noel

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscribe@googlegroups.com.

Alexander Lauper

unread,
Nov 6, 2015, 7:45:07 AM11/6/15
to H2 Database
Thanks Thomas for clarification and Joonas for the hint. As I do not use "SHUTDOWN DEFRAG" I will consider switching to MVStore in future.

MNGoldenEagle

unread,
Nov 8, 2015, 5:25:36 AM11/8/15
to h2-da...@googlegroups.com
Thomas,

Does this mean that there's an auto-migration tool for databases using the stable branch still?  We're using a pagestore DB in our product and would live to switch to MVStore, but that would only be possible if there was a seamless way to migrate from one to the other.

On Fri, Nov 6, 2015 at 6:45 AM, Alexander Lauper <laup...@gmail.com> wrote:
Thanks Thomas for clarification and Joonas for the hint. As I do not use "SHUTDOWN DEFRAG" I will consider switching to MVStore in future.

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.

Noel Grandin

unread,
Nov 8, 2015, 5:30:19 AM11/8/15
to h2-da...@googlegroups.com
No, you'd need to do a backup and import.
Reply all
Reply to author
Forward
0 new messages