[h2] H2 LOB bug - java.io.IOException: org.h2.jdbc.JdbcSQLException: IO Exception: Missing lob:

2013-11-12 Thread Daniel Stone


Hi,

 

We have been using H2 for a while now and have occasionally received the 
following exception when records are read just after being written (often 
by a different thread):

 

Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: 
java.io.IOException: org.h2.message.DbException: IO Exception: 
java.io.IOException: org.h2.jdbc.JdbcSQLException: IO Exception: 
Missing lob: 3113078 [90028-172] [90028-172]; lob: null table: 
48 id: 3113078 [90031-172]

at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:329)

at org.h2.message.DbException.get(DbException.java:158)

at 
org.h2.message.DbException.convertIOException(DbException.java:315)

at org.h2.value.ValueLobDb.getString(ValueLobDb.java:224)

at org.h2.jdbc.JdbcResultSet.getString(JdbcResultSet.java:279)

 

We have managed to work around this problem in most cases as we didn't need 
to read the LOB data or we could change the data type to VARCHAR.   However 
this does appear to be a bug in the H2 transaction management so thought I 
would create this topic.  I can only guess that the LOB data is being 
written asynchronously and is not yet ready before the record is read.  Is 
this expected?

 

We originally had 2 LOB columns: one for storing a Windows path and another 
to hold an XML document.  The column for the path has been changed to a 
VARCHAR but the XML document column has remained a LOB.  We have managed to 
remove most code where this column is read but I am concerned the error 
could still arise.

 

We have also found that a larger table / LOB value can trigger this 
problem.  Any ideas?

 

Regards,

 

Daniel Stone

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [h2] updating self referencing row will cause an Referential integrity constraint violation on a migrated h2 database

2013-11-12 Thread Noel Grandin

Hi

There is some kind of constraint corruption here - the foreign key has become associated with the wrong index 
internally. Not sure how that happened. It was probably a bug in an earlier version that we've fixed already, since I 
could not find a sequence of commands that managed to replicate the situation.


This sequence seems to fix your problem :

ALTER TABLE TERMEJB  DROP CONSTRAINT FK_TERMEJB_MASTERTERM_ID;
DROP INDEX TERMIDMASTERTERMFKINDEX;
ALTER TABLE TERMEJB ADD FOREIGN KEY (MASTERTERM_ID) REFERENCES TERMEJB(ID);

Just be sure to make a backup before you try it.

Regards, Noel.

On 2013-11-11 15:20, Ralf wrote:

FOREIGN KEY (*MASTERTERM_ID*) REFERENCES PUBLIC.TERMEJB(*ID*);


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [h2] H2 LOB bug - java.io.IOException: org.h2.jdbc.JdbcSQLException: IO Exception: Missing lob:

2013-11-12 Thread Noel Grandin


You appear to be running version 1.3.172.

We have fixed quite a few LOB related issues in the last couple of versions, so it's probably worth your while updating 
to 1.3.174 and seeing how that goes.


On 2013-11-12 11:02, Daniel Stone wrote:


We have been using H2 for a while now and have occasionally received the 
following exception when records are read just
after being written (often by a different thread):


--
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [h2] H2 Clusters- load balancing SELECT querries

2013-11-12 Thread Thomas Mueller
Hi,

I'm afraid the current implementation does not support it. Of course this
could be changed, actually I guess it would be relatively easy to remove
the check.

At some point I think it's better to re-implement clustering. But first my
priority is to work on the new storage engine (the MVStore), I plan to use
this mechanism as the base for the new clustering.

Regards,
Thomas
Am 12.11.2013 02:40 schrieb Adam McMahon a...@cs.miami.edu:

 H2 Group,

 I am checking out the clustering features of H2.  I know that the
 clustering features are fairly barebones.  I am  interested in
 using clusters/replication for increased performance, as opposed to simply
 having a failsafe DB online (which is also a good thing  :).

 In the past, using MySQL replication, I would send write queries to the
 master (which would eventually be propogated), and then I would load
 balance between the master/slaves for read queries.  I would do this at the
 application level by simply changing the JDBC url depending on if the SQL
 was a write or a read.  The slaves might be a little behind the master, but
 that was fine for many of my queries.

 I know that load balancing is not a built in feature to H2 clustering, but
 I figured I may be able to accomplish it at the application level using
 something like the above.  However, it seems that I am not able to do so,
 as client connections to an individual server with in a cluster are
 rejected.  I appears we can only connect to using the server list url.

 My question: is there any way to load balance reads across a slave?

 Thanks,  -Adam

 --
 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+unsubscr...@googlegroups.com.
 To post to this group, send email to h2-database@googlegroups.com.
 Visit this group at http://groups.google.com/group/h2-database.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [h2] H2 Clusters- load balancing SELECT querries

2013-11-12 Thread Adam McMahon
Thomas,

This sounds like a good plan, and I realize there is a strong priority for 
the MVStore. 

When I look at the other major DBs: MySQL, Mongo, etc.  They all seem to 
have a feature to allow replication for faster reads. While H2 may fit a 
different market than these other DBs, but it would be nice to have have 
replication performance boosts.

For my particular use case, I use H2 for rest/web services (similar to how 
many people use MySQL/Mongo).  Here is my scalability flow/plan:

1) For for most services, I simply embed H2 in the web server - this works 
great, simple and super fast.
2) If the volume on the services gets too high and heaps sizes are too big, 
H2 is split to client/server mode on the same CPU
3) If the volume continues to increase, then H2 can be put on a dedicated 
server.
4) But what next?  there is no way to scale higher via a cluster.  Because 
of this fact, individuals may pick another DB (which is fine if H2 does not 
want to compete in this space).

Another potential problem of H2 scalability is that of large 
garabage collection pauses on large heap sizes.  This is not a problem with 
H2, but a problem with Java in general.  If someone has a dedicated H2 
server and wants to scale higher, they may not get much more power by 
increasing H2's cache, as I imagine it will (like most Java apps) run into 
problems with large heap sizes.  So, really H2 will likely cap its 
scalabilty on a commodity computer with about 4 GB of ram (if the user is 
concerned with having low latency for requests).

Cluster replication might just save the day here.  When volume of requests 
or heap sizes get too big, replication can be used to scale horizontally. 
 But then again, perhaps I am looking at H2 to do something that it is not 
intended to do, and where another DB may be a better fit, which is fine.

Thanks for your hard work on this great product.

-Adam



On Tuesday, November 12, 2013 8:39:55 AM UTC-5, Thomas Mueller wrote:

 Hi, 

 I'm afraid the current implementation does not support it. Of course this 
 could be changed, actually I guess it would be relatively easy to remove 
 the check. 

 At some point I think it's better to re-implement clustering. But first my 
 priority is to work on the new storage engine (the MVStore), I plan to use 
 this mechanism as the base for the new clustering. 

 Regards, 
 Thomas 
 Am 12.11.2013 02:40 schrieb Adam McMahon ad...@cs.miami.edujavascript:
 :

 H2 Group,

 I am checking out the clustering features of H2.  I know that the 
 clustering features are fairly barebones.  I am  interested in 
 using clusters/replication for increased performance, as opposed to simply 
 having a failsafe DB online (which is also a good thing  :). 

 In the past, using MySQL replication, I would send write queries to the 
 master (which would eventually be propogated), and then I would load 
 balance between the master/slaves for read queries.  I would do this at the 
 application level by simply changing the JDBC url depending on if the SQL 
 was a write or a read.  The slaves might be a little behind the master, but 
 that was fine for many of my queries.

 I know that load balancing is not a built in feature to H2 clustering, 
 but I figured I may be able to accomplish it at the application level using 
 something like the above.  However, it seems that I am not able to do so, 
 as client connections to an individual server with in a cluster are 
 rejected.  I appears we can only connect to using the server list url.

 My question: is there any way to load balance reads across a slave? 

 Thanks,  -Adam

 -- 
 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 javascript:.
 To post to this group, send email to h2-da...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/h2-database.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [h2] updating self referencing row will cause an Referential integrity constraint violation on a migrated h2 database

2013-11-12 Thread Ralf
thx

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.