HI
Sorry to hear that.
If you're in crunch mode, you should probably not be using our beta release - either downgrade to 1.3.176 or run 1.4.181
with MV_STORE=false to use the old storage engine.
I would suggest simply not using isolation levels for H2 - we should be plenty fast enough in our default isolation mode.
Clustering is a very hard problem to do right - We still have so much we could do with the single machine case, that
unless someone else shows up who is keen to hack on that, we are not likely to do much there for quite a while.
At the moment Thomas does 98% of the work, I do about 1% and various random people showing up with patches account for
the other 1%.
A trace log is probably not going to help us very much, but reverting to the old storage engine will probably fix this
for you anyhow.
Regards, Noel.
On 2014-09-16 09:12 AM, Gili wrote:
> I've been H2 for many years but sadly three different factors have compelled me to try to migrate to Postgresql:
>
> 1. The inability to use different isolation levels for different connections (a short-term showstopper).
> 2. A poor clustering story (a long-term showstopper)
> 3. This AUTO_INCREMENT bug (probably easy to fix but it's the straw that broke the camel's back).
> com.vtlr.backend.__ConstraintViolationException: Unique index or primary key violation: "PRIMARY KEY ON
> PUBLIC.USER(ID)"; SQL statement:
> insert into USER (EMAIL, PASSWORD, NAME, OWNED_PERMISSION_ID, OWNER_ID, VIEW_ID, EDIT_ID, DELETE_ID,
> VERSION, LAST_MODIFIED)
> values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-181]
> at com.vtlr.backend.__SqlExceptions.__getConstraintViolation(__SqlExceptions.java:91)
> at com.vtlr.backend.row.User.__insert(User.java:102)
> at com.vtlr.backend.resource.__AnonymousUserResource.__createUser(__AnonymousUserResource.java:85)
> at sun.reflect.__NativeMethodAccessorImpl.__invoke0(Native Method)
> at sun.reflect.__NativeMethodAccessorImpl.__invoke(__NativeMethodAccessorImpl.java:__62)
> at sun.reflect.__DelegatingMethodAccessorImpl.__invoke(__DelegatingMethodAccessorImpl.__java:43)
> at java.lang.reflect.Method.__invoke(Method.java:483)
> at
> org.glassfish.jersey.server.__model.internal.__ResourceMethodInvocationHandle__rFactory$1.invoke(__ResourceMethodInvocationHandle__rFactory.java:81)
> at
> org.glassfish.jersey.server.__model.internal.__AbstractJavaResourceMethodDisp__atcher$1.run(__AbstractJavaResourceMethodDisp__atcher.java:151)
> at
> org.glassfish.jersey.server.__model.internal.__AbstractJavaResourceMethodDisp__atcher.invoke(__AbstractJavaResourceMethodDisp__atcher.java:171)
> at
> org.glassfish.jersey.server.__model.internal.__JavaResourceMethodDispatcherPr__ovider$ResponseOutInvoker.__doDispatch(__JavaResourceMethodDispatcherPr__ovider.java:152)
> at
> org.glassfish.jersey.server.__model.internal.__AbstractJavaResourceMethodDisp__atcher.dispatch(__AbstractJavaResourceMethodDisp__atcher.java:104)
> at org.glassfish.jersey.server.__model.ResourceMethodInvoker.__invoke(ResourceMethodInvoker.__java:387)
> at org.glassfish.jersey.server.__model.ResourceMethodInvoker.__apply(ResourceMethodInvoker.__java:331)
> at org.glassfish.jersey.server.__model.ResourceMethodInvoker.__apply(ResourceMethodInvoker.__java:103)
> at org.glassfish.jersey.server.__ServerRuntime$1.run(__ServerRuntime.java:271)
> at org.glassfish.jersey.internal.__Errors$1.call(Errors.java:271)
> at org.glassfish.jersey.internal.__Errors$1.call(Errors.java:267)
> at org.glassfish.jersey.internal.__Errors.process(Errors.java:__315)
> at org.glassfish.jersey.internal.__Errors.process(Errors.java:__297)
> at org.glassfish.jersey.internal.__Errors.process(Errors.java:__267)
> at org.glassfish.jersey.process.__internal.RequestScope.__runInScope(RequestScope.java:__297)
> at org.glassfish.jersey.server.__ServerRuntime.process(__ServerRuntime.java:254)
> at org.glassfish.jersey.server.__ApplicationHandler.handle(__ApplicationHandler.java:1028)
> at org.glassfish.jersey.servlet.__WebComponent.service(__WebComponent.java:372)
> at org.glassfish.jersey.servlet.__ServletContainer.service(__ServletContainer.java:381)
> at org.glassfish.jersey.servlet.__ServletContainer.doFilter(__ServletContainer.java:534)
> at org.glassfish.jersey.servlet.__ServletContainer.doFilter(__ServletContainer.java:482)
> at org.glassfish.jersey.servlet.__ServletContainer.doFilter(__ServletContainer.java:419)
> at org.eclipse.jetty.servlet.__ServletHandler$CachedChain.__doFilter(ServletHandler.java:__1650)
> at org.eclipse.jetty.servlet.__ServletHandler.doHandle(__ServletHandler.java:583)
> at org.eclipse.jetty.server.__handler.ScopedHandler.handle(__ScopedHandler.java:143)
> at org.eclipse.jetty.security.__SecurityHandler.handle(__SecurityHandler.java:577)
> at org.eclipse.jetty.server.__session.SessionHandler.__doHandle(SessionHandler.java:__223)
> at org.eclipse.jetty.server.__handler.ContextHandler.__doHandle(ContextHandler.java:__1125)
> at org.eclipse.jetty.servlet.__ServletHandler.doScope(__ServletHandler.java:515)
> at org.eclipse.jetty.server.__session.SessionHandler.__doScope(SessionHandler.java:__185)
> at org.eclipse.jetty.server.__handler.ContextHandler.__doScope(ContextHandler.java:__1059)
> at org.eclipse.jetty.server.__handler.ScopedHandler.handle(__ScopedHandler.java:141)
> at org.eclipse.jetty.server.__handler.HandlerWrapper.handle(__HandlerWrapper.java:97)
> at org.eclipse.jetty.server.__Server.handle(Server.java:485)
> at org.eclipse.jetty.server.__HttpChannel.handle(__HttpChannel.java:290)
> at org.eclipse.jetty.server.__HttpConnection.onFillable(__HttpConnection.java:248)
> at
org.eclipse.jetty.io <
http://org.eclipse.jetty.io>.__AbstractConnection$2.run(__AbstractConnection.java:540)
> at org.eclipse.jetty.util.thread.__QueuedThreadPool.runJob(__QueuedThreadPool.java:606)
> at org.eclipse.jetty.util.thread.__QueuedThreadPool$3.run(__QueuedThreadPool.java:535)
> at java.lang.Thread.run(Thread.__java:745)
> Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY KEY ON
> PUBLIC.USER(ID)"; SQL statement:
> insert into USER (EMAIL, PASSWORD, NAME, OWNED_PERMISSION_ID, OWNER_ID, VIEW_ID, EDIT_ID, DELETE_ID,
> VERSION, LAST_MODIFIED)
> values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [23505-181]
> at org.h2.message.DbException.__getJdbcSQLException(__DbException.java:345)
> at org.h2.message.DbException.__get(DbException.java:179)
> at org.h2.message.DbException.__get(DbException.java:155)
> at org.h2.index.PageDataIndex.__getNewDuplicateKeyException(__PageDataIndex.java:165)
> at org.h2.index.PageDataIndex.__add(PageDataIndex.java:143)
> at org.h2.table.RegularTable.__addRow(RegularTable.java:119)
> at org.h2.command.dml.Insert.__insertRows(Insert.java:156)
> at org.h2.command.dml.Insert.__update(Insert.java:114)
> at org.h2.command.__CommandContainer.update(__CommandContainer.java:78)
> at org.h2.command.Command.__executeUpdate(Command.java:__254)
> at org.h2.jdbc.__JdbcPreparedStatement.__executeUpdateInternal(__JdbcPreparedStatement.java:__157)
> at org.h2.jdbc.__JdbcPreparedStatement.__executeUpdate(__JdbcPreparedStatement.java:__143)
> at com.jolbox.bonecp.__PreparedStatementHandle.__executeUpdate(__PreparedStatementHandle.java:__205)
> at com.mysema.query.sql.dml.__SQLInsertClause.__executeWithKeys(__SQLInsertClause.java:302)
> at com.mysema.query.sql.dml.__SQLInsertClause.__executeWithKey(__SQLInsertClause.java:186)
> at com.mysema.query.sql.dml.__SQLInsertClause.__executeWithKey(__SQLInsertClause.java:169)
> at com.vtlr.backend.row.User.__insert(User.java:94)
> ... 45 common frames omitted
>
> If I understand correctly, H2 is complaining that I am inserting a duplicate ID. But as you can see, the ID
> is AUTO_INCREMENT and I am not specifying an explicit value (not ever in any place in my code). Any ideas?
>
> This error is intermittent so I've been unable to create a testcase for it.
>
> Thanks,
> Gili
>
> --
> 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.
> Visit this group at
http://groups.google.com/group/h2-database <
http://groups.google.com/group/h2-database>.
> For more options, visit
https://groups.google.com/d/optout <
https://groups.google.com/d/optout>.
>
> --
> 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 <mailto:
h2-database...@googlegroups.com>.
> To post to this group, send email to
h2-da...@googlegroups.com <mailto:
h2-da...@googlegroups.com>.