I am using H2 database in embeded mode.
After upgrading to 1.4.184 from 1.3.176, INFORMATION_SCHEMA.lobs table grows rapidly. It takes only a week to grow from 140k records to 36million records.When I try to shutdown my app, it takes two hours to clean the table.
I have found the most of the records have "-3" in "table" field as follows:
ID | BYTE_COUNT | TABLE
...
765194 | 12707 | -3
765195 | 1670 | -3
765196 | 1314 | -3
765197 | 1276 | -3
765198 | 382 | -3
765199 | 382 | -3
765200 | 434 | -3
765201 | 1299 | -3
765202 | 353 | -3
765203 | 277 | -3
...
As my reading of H2 source code, the record is for result set, created by LocalResult.cloneLobs method added at r5942.
It seems that H2 cleans the blobs only when the database is closed. You may think it is fine because the database seems to be closed automatically after closeDelay since there is no user session, but it is a problem for me because there are always some user sessions in my application.
I tested it with 1.4.182, 1.4.183, 1.4.184 and 1.4.186 and only 1.4.182 works fine.
Thanks for reading.
--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/WoFDlotV7fo/unsubscribe.
To unsubscribe from this group and all its topics, 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.
--
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.
Hi,I think the version 1.4.186 had some improvements in this area (http://www.h2database.com/html/changelog.html). I can't remember now if there's some protocol to follow when upgrading the version, but one alternative that you could try, is to test again with latest version.
But I disabled MVSTORE and MVCC by "MVSTORE=FALSE;MVCC=FALSE". Does the improvement help me?
--
--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/WoFDlotV7fo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2-database...@googlegroups.com.
(1) add a manual command to clean them up
(2) change it so that the client can only read from a BLOB while a transaction is open. Flush any temporary BLOBs on commit. This is how other databases work, but it would be a change for us. So maybe we would have to hide this option behind a flag for now.
"No guarantees after that.Blob,Clob, andNClobJava objects remain valid for at least the duration of the transaction in which they are created."
Hi,Hm, interesting, Oracle does it the "easy way" then... I didn't know that. That was similar to the original H2 behavior, and them somebody told me this is wrong (I think it was somebody from the Hibernate team, but I don't remember).I don't have MySQL installed right now, could anybody test it? If not, I will install the latest version and test later on.Regards,Thomas
On 2015-03-26 08:48 AM, Thomas Mueller wrote:
I didn't know that. I made some tests (see below), and at least Apache Derby seems to do that. I'm not sure about other
In Oracle, you may only read a BLOB column in the same order as the SELECT statement, and the BLOB ceases to be valid as soon as you read the next column:
http://docs.oracle.com/cd/B28359_01/java.111/b31224/jstreams.htm#BHCDJAGI
Despite a lot of searching, I could not find any information on how this works in Sybase or MS-SQL-Server.
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
Thomas, what did you decide to do for this?
Hi,> But already for many years the spatial support was provided by a combination of geodb + hatbox libraries and integration in GeoTools worldYes. However, those don't use the built-in R tree. Do they use an external R tree?
> All these was done on BLOB type where a geometry WKB is stored.A small BLOB is stored inline, so it might not be that bad.> any access of BLOB value makes a copy of it
Access is making a copy of the reference of a large BLOB.> Isn't it 2Gb is a limit for binary types?I reality the problem is the memory usage (heap memory).
H2GIS is an improvement and refactoring of the H2spatial extension used and developed since 2005 at CNRS. The first release was presented during the GvSIG days in 2006 (https://halshs.archives-ouvertes.fr/halshs-01145771). In fact, the H2 spatial extension was developed to support hydrological spatial analysis methods during my thesis (2002-2005). The first architecture of H2 spatial was very very chaotic :-(. In July 2006, we discover the Chris Holmes (Open plan projet) approach's, available from Derby and HSQL (http://old.geoserver.org/SpatialDBBox.html). The second architecture 2006-2010 follows this approach. A custom blog data type was used to store geometry in H2 database.
In 2011, we decided to contact Thomas to talk with him about spatial index in H2. Thomas was (as usual) very receptive to our needs and he has added a Rtree index storage in H2. Since 2011, we collaborate with the H2 community about the geometry type and a new extension called H2GIS is born.
H2GIS is used in my team to process huge data and create advanced spatial analysis or simulation like noisemap (http://noisemap.orbisgis.org/). For example, we are able to process billion of noise sources located on road network. So yes H2 database is very robust and efficient.
You said « Alltogether very likely I will do refactoring of geodb, hatbox and GeoTools to work with GEOMETRY type... »
I'm working on a extension to connect H2GIS with Geoserver using the Geotools datastore model (https://github.com/ebocher/geoserver-h2gis, thanks to geotools community). May be a good option for you... So you can take profit of all H2GIS functionalities (ST_ConstainedDelunay, Network Analysis, SPHAPEFILE TABLE access...).
My colleague Nicolas Fortin will definitely answer to the technical points (memory usage, data type…).
Best regards
Erwan
--
Nicolas Fortin IRSTV FR CNRS 2488 GIS http://orbisgis.org Spatial DB http://h2gis.org Noise http://noisemap.orbisgis.org
If license is an issue we can always create something simple as geodb wrapper
Have you ever tried H2 as a spatial database behind some GIS interface like UDig or other desktop Java GIS app? It is definitely great db with excellent performance.
SET EXCLUSIVE 1
SET RETENTION_TIME 0
CHECKPOINT_SYNC
SET RETENTION_TIME 45000
SET EXCLUSIVE 0
COMMIT
Hi,Yes, I added a timeout.First I wanted to keep the CLOB / BLOB objects only until the next transaction. The problem is that some methods in JdbcConnection started a new transaction (Statement.getQueryTimeout for example). It would be better if those transactions are not required, but thats a change for another day.Regards,Thomas
Hi,I think he added a timeout for BLOB and CLOB objects:References to BLOB and CLOB objects now have a timeout. The configuration setting is LOB_TIMEOUT (default 5 minutes). This should avoid growing the database file if there are many queries that return BLOB or CLOB objects, and the database is not closed for a longer time.Regards,Fred
2015-04-11 16:07 GMT-03:00 Kenton Garner <kenton...@gmail.com>:
Thomas, what did you decide to do for this?
--
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.
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.
--
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.