[h2] Re: Can't initialize the spatial function.

2017-05-23 Thread Nicolas Fortin (OrbisGIS)
Hi,

This is the H2 support forum. Your question is about H2GIS, please use the 
H2GIS support forum http://h2gis.1099522.n5.nabble.com.

Please explain all the steps of the installation of H2GIS. Where do you 
downloaded the software(url), how do you start h2gis  ?

Thanks

Best regards,

Nicolas FORTIN

Développeur d’applications - AI
Laboratoire d’Acoustique Environnementale (LAE)
Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex

Activités du Laboratoire d’Acoustique Environnementale : www.lae.ifsttar.fr
Un logiciel open-source pour l'acoustique des salles : I-Simpa : 
i-simpa.ifsttar.fr
Retrouvez NoiseCapture (Android App pour la mesure du bruit) et 
NoiseModelling (cartographie du bruit SIG) sur : http://noise-planet.org

Le jeudi 18 mai 2017 08:07:07 UTC+2, fienny angelina a écrit :
>
> Hi, I try to run the h2 console for the first time and try to run these 
> command:
>
> CREATE ALIAS IF NOT EXISTS H2GIS_EXTENSION FOR 
> "org.h2gis.ext.H2GISExtension.load"; CALL H2GIS_EXTENSION();
>
>
> as specified in the quick start guide. however, it says:
>
> CREATE ALIAS IF NOT EXISTS SPATIAL_INIT FOR 
> "org.h2gis.h2spatialext.CreateSpatialExtension.initSpatialExtension";
> Class "org.h2gis.h2spatialext.CreateSpatialExtension" not found; SQL 
> statement:
> CREATE ALIAS IF NOT EXISTS SPATIAL_INIT FOR 
> "org.h2gis.h2spatialext.CreateSpatialExtension.initSpatialExtension" 
> [90086-193] 
> 
>  90086/90086 (Help) 
> 
>
>
> CALL SPATIAL_INIT();
> Function "SPATIAL_INIT" not found; SQL statement:
> CALL SPATIAL_INIT() [90022-193] 
> 
>  90022/90022 (Help) 
> 
>
> Do you have any suggestion what should I do?
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Entries in a table containing Geometries cannot be found when the Geometry is empty ( Row not found when trying to delete from index )

2016-10-18 Thread Nicolas Fortin (OrbisGIS)
Hi,

A Pull request has been merged about the handling of null geometries:

https://github.com/h2database/h2database/pull/267/files

You don't provide any sql sample of the query and the expected result. So I 
don't understand your question.

Regards,

Le mardi 18 octobre 2016 08:40:35 UTC+2, Sven a écrit :
>
> I forgot another way to find such keys, maybe this is even safer. Couldn't 
> the *Page *be passed down to the *contains *function and perform a binary 
> search on the key in question?
>
> public boolean contains(Page p, int index, Object key) {
> SpatialKey a = (SpatialKey) p.getKey(index);
> SpatialKey b = (SpatialKey) key;
>
> if (a.isNull() || b.isNull()) {
> return p.binarySearch(a) >= 0; // <
> }
> for (int i = 0; i < dimensions; i++) {
> if (a.min(i) > b.min(i) || a.max(i) < b.max(i)) {
> return false;
> }
> }
> return true;
> }
>
>
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] What version to pick for production

2016-06-09 Thread Nicolas Fortin (OrbisGIS)
Hi,

The issue is fixed in the pull request. I've tried to run the whole h2 unit 
tests, there is some issues but not related to my changes (fr localizations 
and ports already used)

regards,

Nicolas FORTIN

Développeur d’applications - AI
Laboratoire d’Acoustique Environnementale (LAE)
Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex

Activités du Laboratoire d’Acoustique Environnementale : www.lae.ifsttar.fr
Un logiciel open-source pour l’acoustique des salles : I-Simpa (
i-simpa.ifsttar.fr)
Un logiciel open-source pour des études d’impact en milieu extérieur : 
NoiseM@p (noisemap.orbisgis.org)

Le jeudi 9 juin 2016 09:00:03 UTC+2, Nicolas Fortin (OrbisGIS) a écrit :
>
> Hi,
>
> I'm working on a critical fix caused by null values in geometries :
>
> https://github.com/h2database/h2database/pull/267
>
> Please give me some days before releasing a stable version of H2.
>
> Thanks
>
> Nicolas FORTIN
>
> Développeur d’applications - AI
> Laboratoire d’Acoustique Environnementale (LAE)
> Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex
>
> Activités du Laboratoire d’Acoustique Environnementale : 
> www.lae.ifsttar.fr
> Un logiciel open-source pour l’acoustique des salles : I-Simpa (
> i-simpa.ifsttar.fr)
> Un logiciel open-source pour des études d’impact en milieu extérieur : 
> NoiseM@p (noisemap.orbisgis.org)
>
>
> Le mercredi 8 juin 2016 19:59:53 UTC+2, Thomas Mueller Graf a écrit :
>>
>> Hi,
>>
>> What I could do is make H2 version 1.4.192 "non-beta" now. I didn't want 
>> to do that because for some use cases (according to Steve McLeod), 
>> performance was not great with versions up to and including 1.4.191, and I 
>> didn't know about 1.4.192. But now I have confirmation from Steve 
>> McLeod that performance improved almost to the PageStore level. Not quite 
>> as good, but relatively close. As for stability, I didn't see any major 
>> problems with version 1.4.191 and 1.4.192.
>>
>> What is a bit unexpected is that the jar file of 1.4.192 is compiled with 
>> Java 7, which doesn't match the documentation. This is my mistake.
>>
>> Or, probably easier, is to release version 1.4.193 soon, and mark that as 
>> stable.
>>
>> Regards,
>> Thomas
>>
>>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] What version to pick for production

2016-06-09 Thread Nicolas Fortin (OrbisGIS)
Hi,

I'm working on a critical fix caused by null values in geometries :

https://github.com/h2database/h2database/pull/267

Please give me some days before releasing a stable version of H2.

Thanks

Nicolas FORTIN

Développeur d’applications - AI
Laboratoire d’Acoustique Environnementale (LAE)
Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex

Activités du Laboratoire d’Acoustique Environnementale : www.lae.ifsttar.fr
Un logiciel open-source pour l’acoustique des salles : I-Simpa 
(i-simpa.ifsttar.fr)
Un logiciel open-source pour des études d’impact en milieu extérieur : 
NoiseM@p (noisemap.orbisgis.org)


Le mercredi 8 juin 2016 19:59:53 UTC+2, Thomas Mueller Graf a écrit :
>
> Hi,
>
> What I could do is make H2 version 1.4.192 "non-beta" now. I didn't want 
> to do that because for some use cases (according to Steve McLeod), 
> performance was not great with versions up to and including 1.4.191, and I 
> didn't know about 1.4.192. But now I have confirmation from Steve 
> McLeod that performance improved almost to the PageStore level. Not quite 
> as good, but relatively close. As for stability, I didn't see any major 
> problems with version 1.4.191 and 1.4.192.
>
> What is a bit unexpected is that the jar file of 1.4.192 is compiled with 
> Java 7, which doesn't match the documentation. This is my mistake.
>
> Or, probably easier, is to release version 1.4.193 soon, and mark that as 
> stable.
>
> Regards,
> Thomas
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Spatial index problem

2016-04-26 Thread Nicolas Fortin (OrbisGIS)
I'm sorry but I can't fix an issue that I can't reproduce on my computer.

Le mardi 26 avril 2016 12:26:31 UTC+2, Blaž Repnik a écrit :
>
> I updated my local code with:
>
> if (p.isLeaf()) { for (int i = 0; i < p.getKeyCount(); i++) { if (keyType.
> equals(p.getKey(i), key)) { + p.setKey(i, key); return p.setValue(i, 
> value); } }
> while it does fix the problem with demo sql script, it does not fix the 
> problem with my actual table. It works fine without the spatial index, but 
> not with it.
>
>
>
> Dne torek, 26. april 2016 11.12.43 UTC+2 je oseba Nicolas Fortin 
> (OrbisGIS) napisala:
>>
>> Hi,
>>
>> The issue has been created and the pull request is done. Waiting for the 
>> check and the possible merge on the h2 team side:
>>
>> https://github.com/h2database/h2database/pull/267
>>
>> Best regards,
>>
>> Nicolas Fortin,
>>
>> Développeur d’applications - AI
>> Laboratoire d’Acoustique Environnementale (LAE)
>> Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex
>>
>> Activités du Laboratoire d’Acoustique Environnementale : 
>> www.lae.ifsttar.fr
>> Un logiciel open-source pour l’acoustique des salles : I-Simpa (
>> i-simpa.ifsttar.fr)
>> Un logiciel open-source pour des études d’impact en milieu extérieur : 
>> NoiseM@p (noisemap.orbisgis.org)
>>
>>
>>
>>
>> Le mardi 26 avril 2016 11:02:56 UTC+2, Blaž Repnik a écrit :
>>>
>>> Excellent. Any info about when the patch will be commited? Thanks!
>>>
>>>
>>> Dne torek, 26. april 2016 09.09.14 UTC+2 je oseba Nicolas Fortin 
>>> (OrbisGIS) napisala:
>>>>
>>>> Hi,
>>>>
>>>> Yes it seems that update on null geometry does not update the index. 
>>>> Using the following query
>>>>
>>>> drop table if exists DUMMY_11;CREATE TABLE PUBLIC.DUMMY_11 (fid serial,  
>>>> GEOM GEOMETRY);CREATE SPATIAL INDEX PUBLIC_DUMMY_11_SPATIAL_INDEX on 
>>>> PUBLIC.DUMMY_11(GEOM);insert into PUBLIC.DUMMY_11(geom) 
>>>> values(null);update PUBLIC.DUMMY_11 set geom = 'POLYGON((1 1,5 1,5 5,1 5,1 
>>>> 1))';select fid, GEOM from DUMMY_11 where  GEOM && 'POLYGON((1 1,5 1,5 5,1 
>>>> 5,1 1))';
>>>>
>>>> I will add this on unit test of h2 and test it.
>>>>
>>>> Thank you for the report.
>>>>
>>>> Best regards,
>>>>
>>>> Nicolas Fortin,
>>>>
>>>> Développeur d’applications - AI
>>>> Laboratoire d’Acoustique Environnementale (LAE)
>>>> Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex
>>>>
>>>> Activités du Laboratoire d’Acoustique Environnementale : 
>>>> www.lae.ifsttar.fr
>>>> Un logiciel open-source pour l’acoustique des salles : I-Simpa (
>>>> i-simpa.ifsttar.fr)
>>>> Un logiciel open-source pour des études d’impact en milieu extérieur : 
>>>> NoiseM@p (noisemap.orbisgis.org)
>>>>
>>>> Le lundi 25 avril 2016 16:35:11 UTC+2, Blaž Repnik a écrit :
>>>>
>>>> Hey!
>>>>>
>>>>> I have a table into which i insert records with polygonal geometry. 
>>>>> And the problem is that some records do not show in the resultset when 
>>>>> using the spatial query (&& WKT_GEOM). I checked manually that the 
>>>>> geometry 
>>>>> of the inserted features overlaps (actually the are completely within) 
>>>>> the 
>>>>> query geometry. If i drop the spatial index and recreate it, i get the 
>>>>> missing records!
>>>>>
>>>>> I was not able to produce a working example on a simple table (my 
>>>>> table has about 30 columns). But this is what i do:
>>>>>
>>>>> First i insert the record with null geometry, then i update the 
>>>>> geometry column with "normal" geometry. So i guess the problem lies in 
>>>>> updating the spatial index? Any ideas?
>>>>>
>>>>> Also, i'm using the 191 version.
>>>>>
>>>>> Thanks!
>>>>>
>>>> ​
>>>>
>>>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Problems with spatial index

2016-03-16 Thread Nicolas Fortin (OrbisGIS)
Hi,

I don't think your bounding box and the geometry CRS are the same in your 
query.

You should also use rs.getObject("the_geom"), it returns a jts Geometry 
object. The same way for prepared statements parameters you should use 
setObject(p, myBBox)

Regards,

Nicolas FORTIN

H2GIS team member

Développeur d’applications - AI
Laboratoire d’Acoustique Environnementale (LAE)
Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex


Le mardi 15 mars 2016 18:57:16 UTC+1, Bernd Lauert a écrit :
>
> Thank you,
>
> I discovered that when i'm only using srid:4326 layers there are no 
> problems at all and its working perfect. When i add a srid:28992 layer as 
> first layer my 4326 layers are 1 at 30 times not displayed. When i use my 
> srid:28992 layers as last layer it works 9 at 10 times but that one time 
> when it doesen't work one of my 4326 layer is gone or all the 4326 layers 
> are gone. Also the h2gis i get when i use orbisgis maven h2gis-dist seems a 
> little bit more stable then the zip from h2gis.org. I will keep 
> experimenting and give updates.
>
>>
>>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: Problems with spatial index

2016-03-15 Thread Nicolas Fortin (OrbisGIS)
Hi,

The intersection is done using the stored coordinate. Your problem may be a 
projection issue. The && operator is a *bounding box* intersection. 
ST_Intersects will take the geometry, but it is much slower. The solution 
is to merge the two methods as you have already done.

There is a lot of unit testing on intersection and index operation in h2. 
We are open to add more unit test if you can provide a data and query 
sample in order to simulate the issue on our side.

Regards,

Nicolas FORTIN

H2GIS team member

Développeur d’applications - AI
Laboratoire d’Acoustique Environnementale (LAE)
Ifsttar Nantes, Route de Bouaye, CS 4, 44344 Bouguenais Cedex
Tél. +33 (0)2 40 84 57 91 

Activités du Laboratoire d’Acoustique Environnementale : www.lae.ifsttar.fr
Un logiciel open-source pour l’acoustique des salles : I-Simpa 
(i-simpa.ifsttar.fr)
Un logiciel open-source pour des études d’impact en milieu extérieur : 
NoiseM@p (noisemap.orbisgis.org)

Le mercredi 9 mars 2016 13:18:57 UTC+1, Bernd Lauert a écrit :
>
> Hello,
>
> I am experiencing some problems with requesting geometries from inside a 
> bounding box using spatial indexing inside my gis application. The problem 
> is that sometimes a query gives 0 results and when i'm changing my map 
> position a very small bit i get lots of results. Sometimes when i get 
> results in my application and when i do the same query in de h2 webserver 
> the query in the h2 console does not give any results. Another thing is 
> that when i only use the intersects command i get more results then when i 
> use the ST_Intersects command provided by h2gis. Thats why i do the 
> ST_Intersects command as last.
> This is an example from my code: 
> https://github.com/ffk27/h2gisviewer/blob/master/src/com/example/JDBCHandler.java
> Could someone help me with this or can i better contact the h2gis team? 
> Sorry for my bad english.
>
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: H2 and jts-1.113.jar issues

2016-02-22 Thread Nicolas Fortin (OrbisGIS)
Even if you use embedded database the program is running in the background. 
Before running the .bat make sure that http://localhost:8082 is unavailable.

Nicolas Fortin
Software developer
Laboratoire d’Acoustique Environnementale (LAE) Ifsttar Nantes

Le lundi 22 février 2016 14:47:55 UTC+1, ray.b...@gmail.com a écrit :
>
> Thanks. I've made sure that there are no other processes running H2 since 
> I'm using it as an embedded database.
>
> On Monday, February 22, 2016 at 6:41:30 AM UTC-7, Nicolas Fortin 
> (OrbisGIS) wrote:
>>
>> Please note that H2 is running in the background. You have to stop H2 
>> before running it again (Options/Stop menu in browser or Right click/Exit 
>> on H2 task bar near the clock) 
>>
>> Best regards,
>>
>> Nicolas Fortin
>> Software developer
>> Laboratoire d’Acoustique Environnementale (LAE) Ifsttar Nantes
>>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: H2 and jts-1.113.jar issues

2016-02-22 Thread Nicolas Fortin (OrbisGIS)
Please note that H2 is running in the background. You have to stop H2 
before running it again (Options/Stop menu in browser or Right click/Exit 
on H2 task bar near the clock) 

Best regards,

Nicolas Fortin
Software developer
Laboratoire d’Acoustique Environnementale (LAE) Ifsttar Nantes

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: H2 and jts-1.113.jar issues

2016-02-22 Thread Nicolas Fortin (OrbisGIS)
Hi,

I was talking about the master version of H2.

For the version 1.4.191, copy the specified jar file 
http://search.maven.org/remotecontent?filepath=com/vividsolutions/jts/1.13/jts-1.13.jar
 
into the bin directory then edit h2.bat and just add the new jar:

@java -cp "h2-1.4.191.jar;jts-1.13.jar;%H2DRIVERS%;%CLASSPATH%" 
org.h2.tools.Console %*
@if errorlevel 1 pause

I checked under windows 7, the following query is working:

create table testgeom(id serial, the_geom geometry) as select null, 
'POINT(5 10)';

Regards,

Nicolas Fortin

Software developer
Laboratoire d’Acoustique Environnementale (LAE) Ifsttar Nantes


Le lundi 22 février 2016 06:40:53 UTC+1, ray.b...@gmail.com a écrit :
>
> I've been trying to use the newer spatial functions in H2 by exploiting 
> the JTS library. In my application, I'm utilizing H2 in embedded mode 
> within an Eclipse project. While in Eclipse, I have access to spatial 
> functionality without problems. When I try to view the database in the H2 
> web page, I have issues. My program is adding GEOMETRY objects to a table 
> just fine, and I can pull them out of H2 just fine while in Eclipse.
>
> I think what is happening is that H2 cannot find the JTS library on the 
> classpath. I'm getting the following exception when I try to open up an H2 
> database in the browser with GEOMETRY types in it:
>
> org.h2.jdbc.JdbcSQLException: General error: 
> "java.lang.NoClassDefFoundError: com/vividsolutions/jts/io/ParseException" 
> [5-191] 
>
> If I try to open a database without GEOMETRY types, the H2 web page runs 
> without problems and I can see the tables.
>
> I've followed the instructions for dropping jts-1.13.jar in the bin 
> directory. Since I'm on Windows, I also added jts-1.13.jar to the classpath 
> in the h2.bat file. Here's what the batch file looks like:
>
> @java -cp "h2-1.4.191.jar;jts-1.13.jar;%H2DRIVERS%;%CLASSPATH%" 
> org.h2.tools.Console %*
> @if errorlevel 1 pause
>
> I've also tried running an older version of H2 (h2-1.3.176.jar), but I 
> always get the same results.
>
> Any ideas?
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Re: H2 and jts-1.113.jar issues

2016-02-22 Thread Nicolas Fortin (OrbisGIS)
Hi,

The JTS version is now 1.14.0 . You can download it on official repository:

http://search.maven.org/remotecontent?filepath=com/vividsolutions/jts-io/1.14.0/jts-io-1.14.0.jar
http://search.maven.org/remotecontent?filepath=com/vividsolutions/jts-core/1.14.0/jts-core-1.14.0.jar

We have to update the website in consequence.

Thanks for your feedback

Best regards,

Nicolas Fortin
Software developer
Laboratoire d’Acoustique Environnementale (LAE) Ifsttar Nantes

Le lundi 22 février 2016 06:40:53 UTC+1, ray.b...@gmail.com a écrit :
>
> I've been trying to use the newer spatial functions in H2 by exploiting 
> the JTS library. In my application, I'm utilizing H2 in embedded mode 
> within an Eclipse project. While in Eclipse, I have access to spatial 
> functionality without problems. When I try to view the database in the H2 
> web page, I have issues. My program is adding GEOMETRY objects to a table 
> just fine, and I can pull them out of H2 just fine while in Eclipse.
>
> I think what is happening is that H2 cannot find the JTS library on the 
> classpath. I'm getting the following exception when I try to open up an H2 
> database in the browser with GEOMETRY types in it:
>
> org.h2.jdbc.JdbcSQLException: General error: 
> "java.lang.NoClassDefFoundError: com/vividsolutions/jts/io/ParseException" 
> [5-191] 
>
> If I try to open a database without GEOMETRY types, the H2 web page runs 
> without problems and I can see the tables.
>
> I've followed the instructions for dropping jts-1.13.jar in the bin 
> directory. Since I'm on Windows, I also added jts-1.13.jar to the classpath 
> in the h2.bat file. Here's what the batch file looks like:
>
> @java -cp "h2-1.4.191.jar;jts-1.13.jar;%H2DRIVERS%;%CLASSPATH%" 
> org.h2.tools.Console %*
> @if errorlevel 1 pause
>
> I've also tried running an older version of H2 (h2-1.3.176.jar), but I 
> always get the same results.
>
> Any ideas?
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


[h2] Check for cancel statement into user defined function

2015-11-17 Thread Nicolas Fortin (OrbisGIS)
Hi,

We write some user defined h2 function that take a lot of time to deliver a 
row. We want to find a way to check if Statement.cancel( ) has been called 
inside the custom function code. May be through the providing of hidden 
argument in the function like the Connection.

 Have you any idea to break the current limitation and allow users to check 
cancel without casting into h2 internals class ?

Thanks

-- 
Nicolas Fortin
Lab-STICC – CNRS UMR 6285 et Ecole Centrale de Nantes
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org


-- 
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/d/optout.


[h2] Re: Indexing user defined tables

2015-10-29 Thread Nicolas Fortin (OrbisGIS)
Hello,

We have implemented our own TableEngine for external DBF files (DBASE III) 
It support virtual primary key column, spatial index (only for SHP files), 
and have some easy to use interfaces in order to add future offdb tables.

The table implementation is here
https://github.com/orbisgis/h2gis/blob/master/h2drivers/src/main/java/org/h2gis/drivers/file_table/H2Table.java
And the API is here
https://github.com/orbisgis/h2gis/blob/master/h2drivers/src/main/java/org/h2gis/drivers/FileDriver.java

We are also interested in the availability of create index of fields in 
user defined table engines.

Regards,

-- 
Nicolas Fortin
Lab-STICC – CNRS UMR 6285 et Ecole Centrale de Nantes
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le mercredi 28 octobre 2015 13:29:17 UTC+1, Dietmar Höhmann a écrit :
>
> I'm thinking about an open source tool to make Lotus Notes databases 
> available as H2 user defined tables. Unfortunately we have no indexes in 
> Notes that would be of much use in this context. My question: Is it 
> possible to provide the raw table data as user defined table and let H2 do 
> the indexing?
>

-- 
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/d/optout.


Re: [h2] (Geo)Raster support in H2 database

2015-09-10 Thread Nicolas Fortin (OrbisGIS)
Hi,

Its a bit early to define all features but the current goal with h2 raster 
patch is:

- PostGIS raster WKB compatibility
- Only Raster meta-data in memory, pixels are transferred through streams.
- Spatial index
- Empty Raster creation
- ST_METADATA function

Maybe:
- Raster creation from PNG
- ST_ASPNG function
- User defined (admin) drivers for bands stored on external files (ex: 
external tiff)
- getObject( ) return a java.awt.image.Raster object.

H2GIS will host h2 functions linked with JAI library implementation.

JTS is still required as it is used in spatial index.

Regards,

 -- 

Nicolas Fortin
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le jeudi 10 septembre 2015 16:02:59 UTC+2, Sergi Vladykin a écrit :
>
> Pretty interesting! 
> Does it mean that geospatial capabilities will be available in H2 out of 
> the box? Or it will be some separate distribution?
>
> Sergi
>
> 2015-09-10 16:09 GMT+03:00 bocher :
>
>>
>> Dear community and H2 leaders,
>>
>> A short mail to inform you that the OrbisGIS team is working hardly to 
>> support a raster data type (à la POSTGIS) in H2 database. This new type 
>> will be a standalone implementation in H2 without any dependencies.
>>
>> To keep track of the raster development  : 
>> https://github.com/orbisgis/h2gis/.
>>
>> and feel free to follow the H2GIS lead developer Nicolas Fortin : 
>> https://github.com/nicolas-f/h2database/tree/georaster_patch
>>
>> The LAB-STICC CNRS laboratory will be happy to share in few weeks this 
>> new data type to the H2 community.
>>
>> Best regards.
>>
>> -- 
>> Erwan Bocher
>> -
>> Ingénieur de Recherche CNRS,
>> Laboratoire Lab-STICC – CNRS UMR 6285
>> Centre de Recherche - BP 92116
>> 56321 LORIENT
>> UNIVERSITÉ DE BRETAGNE-SUD
>> T: +33 2 97 87 45 60
>> W: https://cv.archives-ouvertes.fr/erwan-bocher
>> W: http://www.univ-ubs.fr
>>
>>
>>
>>
>>
>>
>> -- 
>> 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.
>>
>
>

-- 
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/d/optout.


Re: [h2] Using H2 as an embedded database for CAD/GIS software

2015-08-05 Thread Nicolas Fortin (OrbisGIS)
Hello,

Steve Hruda was working on an interface with JTS as default implementation :
https://github.com/shruda/H2-Mirror/tree/AbstractValueGeometry

You have API here
https://github.com/shruda/H2-Mirror/blob/AbstractValueGeometry/h2/src/main/org/h2/api/IValueGeometryFactory.java

I don't know if that was finished.

Regards,

Nicolas Fortin

Le mardi 4 août 2015 07:45:31 UTC+2, Thomas Mueller a écrit :

 Hi,

 Sure, the spatial index can be switched to double. Maybe it makes sense to 
 support both, as float uses less space, and maybe it makes sense to be 
 backward compatible. What do other think about this?

 About not relying on the JTS suite, I'm think we would need your help, for 
 example in the form of a patch.

 Regards,
 Thomas



-- 
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/d/optout.


Re: [h2] How to reproduce the Explain command output programmatically?

2015-06-12 Thread Nicolas Fortin (OrbisGIS)
Hi,

I don't understand all but You can track queries if you are using the 
DatabaseEventListener:

https://github.com/h2database/h2database/blob/master/h2/src/main/org/h2/api/DatabaseEventListener.java

Generally we use connection url to set a event listener however you may be 
able to force it using another way.

Regards,

 
 
-- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org


Le vendredi 12 juin 2015 00:37:29 UTC+2, Pablo Beltran a écrit :

 Well, it looks like it is achievable by using the Parser - collect all 
 the conditions recursively (conditionAndOr lef,right) - getting the 
 tableName for each condition and its left and right columns (expressions, 
 values, etc). Hence the Explain command and the Plan were not the best 
 approach. Sorry but I'm not yet too much familiar with the API furthermore 
 a lot of methods to explore parsed queries are not public... Anyway thanks.

 2015-06-11 18:47 GMT+02:00 Pablo Beltran pbel...@gmail.com javascript:
 :

 The new attached picture (explain-plan_2.png) may help to understand it 
 better. it's an screenshot of a query against two plugged tables. I've 
 added some conditions (where clause) for each table. The execution plan is 
 really awesome as the /* function */ comments show how the conditions 
 affect to each table.

 With the plan I'm able to figure out that the query will perform well 
 against the 3rd party system because each table includes values for the 
 required columns. Otherwise it should/might be aborted.

 thanks.



 2015-06-11 18:25 GMT+02:00 Pablo Beltran

 Surely my question was not good and it brought some confusion. 

 I need to access to the internal API because I'm using the H2 engine 
 with plugged tables from a 3rd party system (not a database). Then I 
 capture the users' queries just before invoke the 3rd party system and 
 populate the plugged tables with the fetched data from the 3rd party 
 system and some of those queries must be aborted if the users do not 
 use the indexes in the right way.

 Note: indexes are not indexes in the strict sense (defined on some 
 columns of a table). They are columns that users MUST include in the where 
 clause because are required by the 3rd party system API, but the users are 
 free for not doing it. Hence, If I was able to get the Plan I could analyze 
 the tables and the columns used by the users to filter data and validate 
 them against the scheme and abort potential full scans against the 3rd 
 party system, etc The best approach to achieve it is the execution plan as 
 it knows the execution order for the tables a well as the columns used as 
 filters for each table.

 I tried to resolve it by analyzing the query syntax with the Parser: get 
 the all the conditions etc. but it is a weak way and pretty difficult due 
 the complexity of the SQL syntax, so I discarded this approach, even more 
 after i saw that the Explain command is able to do such job much better.

  
 Could you help please?

 Thanks,
 Pablo

 2015-06-11 18:08 GMT+02:00 Thomas Mueller thomas.to...@gmail.com:

 Hi,

 I don't understand, you just call st.execute(explain select * from 
 table). No need to use the internal API.

 Regards,
 Thomas


 On Thursday, June 11, 2015, Pablo Beltran pbel...@gmail.com wrote:

 Hi,

 i would like to  get the same text jist like the H2 Web Console when a 
 plan is explained (Pls, see the attached picture), but I did not get it 
 yet 
 unfortunately.



 Connection conn  = 


 Statment st = con.createStatment(SELECT * FROM TABLE),
 st.executeQuery();

 


 JdbcConnection jdbcConnection = (JdbcConnection) conn;
 Session session = (Session) jdbcConnection.getSession();
 Command current = session.getCurrentCommand(); //this method has been 
 added to the Session class.
 Parser parser = new Parser(session);
 Prepared prepared = parser.prepare(current.toString()); //SELECT * 
 FROM TABLE
 Explain exp = new Explain(session);
 exp.setCommand(prepared); 

 and next??

 I've tried several things from here but without too much success.

 Any idea?

 Thanks in advance!
 Pablo.






-- 
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/d/optout.


Re: [h2] Suitability of mvstore (stand-alone) in Android : robustness, processes killed, etc

2015-06-02 Thread Nicolas Fortin (OrbisGIS)
Hi,

I try to write the unit test with thread killing. As I can't reconnect to 
the DB I'm facing some problem to check if the database is corrupted. (see 
attached traceback)

https://github.com/nicolas-f/h2database/tree/thread_kill_mvstore

As I said before, I want to reproduce a problem of corrupted db we have in 
production when using this kind of brutal thread kill.

regards,

-- 
 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le jeudi 28 mai 2015 22:04:22 UTC+2, Thomas Mueller a écrit :

 Hi,

 That's very interesting. 

 So far I know about a potential problem in case of power failure, and I'm 
 working on fix for that. This is related to write re-ordering. Recovery is 
 affected, and truncating the file needs to be delayed, but both should be 
 quite simple to fix.

 However, the problem you describe is not related to power failure. I would 
 be very interested in a test case!

 Regards,
 Thomas



-- 
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/d/optout.


threadkill.trace.db
Description: Binary data


Re: [h2] Suitability of mvstore (stand-alone) in Android : robustness, processes killed, etc

2015-05-28 Thread Nicolas Fortin (OrbisGIS)
Hi,

Using 
https://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Future.html#cancel%28boolean%29
 
this method I was able to trigger corrupted MVStore. I could help by 
building unit test in this case. When statement.cancel( ) can't do the job, 
this kind of Thread kill can be somewhat useful.

Regards,

-- 
 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le vendredi 8 mai 2015 07:42:36 UTC+2, Thomas Mueller a écrit :

 Hi,

 I would like clarification on one item:* can I use mvstore reliably 
 without calling .close().*


 Yes, that should work. However, please note that this scenario is not 
 fully tested yet (as much as with SQLite). At the moment, I would either 
 ensure it works for you with your own tests, or don't store very important 
 data unless you do regular backups.

 Regards,
 Thomas



-- 
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/d/optout.


[h2] Re: H2 on Android : How to?

2015-05-21 Thread Nicolas Fortin (OrbisGIS)
Hi,

We have some projects that run H2 and H2GIS on android here:
https://github.com/orbisgis/h2gis_android

See branch for other examples.

These projects were done by students. We do not use it till now.

Regards,

-- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org

Le mardi 19 mai 2015 18:20:35 UTC+2, IQBAL YUSUF a écrit :

 Hello,

 Is there any tutorial available on how to install H2 on Android?

 Thanks,
 Iqbal


-- 
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/d/optout.


[h2] Re: H2 seems to create a huge number of orphan lobs since 1.4.183.

2015-05-06 Thread Nicolas Fortin (OrbisGIS)
hi,

If license is an issue we can always create something simple as geodb  
 wrapper


UDig (main application) license is BSD. In order to be able to link with 
GPL based source code you need to include the GPL as well as the original 
license, and you need to make it clear that each individual file as a whole 
is covered by the GPL, as well as BSD for portions of it.

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.


We develop our own desktop GIS OrbisGIS 5.1 which is working with H2GIS 
under the hood (or PostGIS) with direct access to SQL. 
http://www.orbisgis.org/download/

Erwan B. have successfully linked GeoServer with H2GIS too.

Regards,

-- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org 
http://www.google.com/url?q=http%3A%2F%2Fh2gis.orgsa=Dsntz=1usg=AFQjCNH3xVHyQCTdh2pCB5uHdgu5F0u-yg
Noise  http://noisemap.orbisgis.org

 

-- 
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/d/optout.


[h2] Re: H2 seems to create a huge number of orphan lobs since 1.4.183.

2015-05-05 Thread Nicolas Fortin (OrbisGIS)
Hi Vitali,

PostGIS maximum geometry field size is 1Gb[1], then i don't think its a 
problem for H2 having a theoretical limit of 2.1 Gb (precisely 231-5 [2]) . 
It is not very practical to have such huge geometry as it is slow to render 
and process (no stream processing for vectorial geometries in jts).

As Thomas have said you have now access to native spatial r-tree index with 
the same syntax as PostGIS ( operator):
http://www.h2database.com/html/advanced.html#spatial_features

There is just a missing piece with spatial index is the support for sql 
alias in h2. In order to link  operator with spatial predicates.

I understand if GPLv3 license of H2GIS is a issue for you that you want to 
update geotools and geodb (you don't need hatbox anymore).

All our 744 units test of H2GIS are running fine with H2 MvStore. We 
greatly appreciate the power of H2 database :)

Regards,


 [1]:http://www.postgresql.org/about/
 
[2]:http://stackoverflow.com/questions/3038392/do-java-arrays-have-a-maximum-size

 -- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le dimanche 3 mai 2015 21:51:09 UTC+2, Vitali a écrit :

 Hello.

 I would like to share some   observations.  Recently H2 got a Geometry 
 type, logic around it seems is growing, also some extra tiers like H2GIS 
 are under development.  All together this seems as a future of spatial 
 support in H2.  But already for many years  the spatial support was 
 provided by a combination of geodb + hatbox libraries and integration in 
 GeoTools  world (as  H2 data store  interface for storing/managing spatial 
 features with geometries).
 All these was done on BLOB type where a geometry WKB is stored. 

 BLOB became completely useless as a type for handling WKB of geometries. 
 Because of  this change that any access of BLOB value makes a copy of it. 
 HATBOX and GEODB libs based  on JTS library  provide functions to work with 
 WKB. But any call of these functions makes a read of BLOB value which makes 
 a copy in memory.  Some spatial conflation operations being not-optimized 
 (having polynomial complexity with applying spatial predicates between any 
 combination of input geometries from 2 tables e.g.)  now have a 
 catastrophic performance and memory consumption.  Cases where  old H2 just 
 worked 10 secods performing some kind of spatial operation between 2 layers 
 (tables) now runs 2 hours , 3Gb of database file (instead of 400Mb 
 normally) and outofmemory error finally. And long cleanings of temporary 
 LOB storage on app start, app close, transaction commit after such 
 operations.

 I understand real reasons of this BLOB  copying approach.  But the 
 conclusion is that BLOB is not a right type for geometries. In typical GIS 
 (like UDIG) thousands of records are extracted every second for multiple 
 layers during rendering and other types of requests need geometries. Now 
 BLOB became inefficient.

 Alltogether very likely I will do refactoring of geodb, hatbox and 
 GeoTools to work with GEOMETRY type which is basically VARBINARY kind of 
 which means WKB is just read to memory. But it is what usually is needed to 
 GIS app - to get a geometry almost every time when data is read. Also 
 because  JTS geometry is lazily cached in ValueGeometry various logic in H2 
 (like custom spatial functions call multiple times) gets benefits.  I think 
 H2GIS toolkit more or less uses this approach already.

 The only concern is that are there any limitations for cases like lake 
 boundary that consists from hundreds of  thousands of vertices.. Isn't it  
 2Gb is a limit for binary types? Then it's fine..  But how do older 
 PageStore and modern MVStore handle this type? Any performance issues?

 Vitali.




-- 
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/d/optout.


[h2] Use travis in H2

2015-04-27 Thread Nicolas Fortin (OrbisGIS)
Hi,

Now that H2 is in Github it is easy to use travis in order to run (light) 
unit test of H2 on each push and pull request. It is free for open source 
projects and have nice integration in Github pages.

You can find an example here with custom sh:

https://github.com/irstv/H2GIS

Travis documentation:

http://docs.travis-ci.com/user/customizing-the-build/#Customizing-the-Build-Step

regards,

 -- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org


-- 
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/d/optout.


[h2] Re: Using H2 with Python

2015-04-25 Thread Nicolas Fortin (OrbisGIS)
Hi,

If you want h2 dialect and are not afraid of programming there is an 
interesting project:
https://pypi.python.org/pypi/JayDeBeApi/

Its seems there is already HSQLDB support, this is quite close to H2.

Regards,
-Nicolas

Le samedi 25 avril 2015 11:35:24 UTC+2, DecebalICT a écrit :

 I need to work with Python again and would like to use H2 there also. The 
 'best' way is to use SQLAlchemy. On the site H2 was not named. So I 
 inquired about that. The reply I got was:

 SqlAlchemy needs 2 things for a database work:
 
 1. A python database driver
 2. A SqlAlchemy dialect (that tells SqlAlchemy how to write sql for 
 the driver)
 
 So...
 
 1. H2 doesn't seem to have any Python drivers or other support.  I 
 just came across an old forum post that talked about possibly using 
 Postgresql client since they supported similar protocols, but that's about 
 all I could find.
 
 2. There are a handful of posts and articles on writing custom 
 dialects.  Several recent ones as well.
 
 If you're just trying to handle the dialect, and their syntax is 
 reasonably similar to an existing dialect... I think you could do it alone.
 
 If you have to write the general Python support as well though, that's 
 a bigger task.

 Anyone a comment on this? I would like to make SQLAlchemy work with H2, 
 but at the moment do not know where to start and even if it is feasible. 
 Could the PostgreSQL client be used, or is it necessary to write a Python 
 database driver?

 -- 
 Cecil Westerhof
  

-- 
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/d/optout.


Re: [h2] Any plan to move issues on googlecode to github ?

2015-04-15 Thread Nicolas Fortin (OrbisGIS)
Hi Thomas,

Transfer of google code account seems to work well. However you should have 
transferred the repository from github.com/thomasmueller/h2database to 
github.com/h2database/h2database instead of fork it. 
https://help.github.com/articles/transferring-a-repository/

You are right this can still be resolved.

Regards,

 -- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le mardi 14 avril 2015 19:48:15 UTC+2, Thomas Mueller a écrit :

 Hi,

 There was a problem migrating the Google Code issues to Github. Maybe this 
 can still be resolved, but maybe its simpler to just keep the old issues in 
 Google Code and not migrate them.

 For now, I would prefer if you just send an email with the issue report to 
 this group instead of using the issue tracker at Google Code or Github.

 Regards,
 Thomas


 On Tue, Apr 14, 2015 at 7:39 PM, wener wene...@gmail.com javascript: 
 wrote:

 Any plan to move issues on googlecode to github ?


 [image: ]

 -- 
 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.com 
 javascript:.
 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+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/d/optout.


[h2] Re: NULL Geometry index problem

2015-04-07 Thread Nicolas Fortin (OrbisGIS)
Hi,

Sorry I didn't notice, shruda solve this issue and it has been merged in h2:

https://code.google.com/p/h2database/source/detail?r=6088

Regards,

 -- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org 
http://www.google.com/url?q=http%3A%2F%2Fh2gis.orgsa=Dsntz=1usg=AFQjCNH3xVHyQCTdh2pCB5uHdgu5F0u-yg
Noise  http://noisemap.orbisgis.org



Le mardi 7 avril 2015 13:38:23 UTC+2, John McMahon a écrit :

 We are experiencing null pointer exceptions when we attempt to store a 
 null geometry in H2 when we close the connection

 Attached is a small test.

 org.h2.jdbc.JdbcSQLException: General error: 
 java.lang.NullPointerException [5-186]
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
 at org.h2.message.DbException.get(DbException.java:168)
 at org.h2.message.DbException.convert(DbException.java:295)
 at org.h2.message.DbException.toSQLException(DbException.java:268)
 at org.h2.message.TraceObject.logAndConvert(TraceObject.java:352)
 at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:392)
 at com.intergraph.test.NullGeometryTest.startTest(NullGeometryTest.java:46)
 at com.intergraph.test.NullGeometryTest.main(NullGeometryTest.java:21)
 Caused by: java.lang.NullPointerException
 at org.h2.mvstore.rtree.SpatialDataType.write(SpatialDataType.java:89)
 at org.h2.mvstore.rtree.SpatialDataType.write(SpatialDataType.java:80)
 at org.h2.mvstore.Page.write(Page.java:735)
 at org.h2.mvstore.Page.writeUnsavedRecursive(Page.java:818)
 at org.h2.mvstore.MVStore.storeNowTry(MVStore.java:1057)
 at org.h2.mvstore.MVStore.storeNow(MVStore.java:973)
 at org.h2.mvstore.MVStore.commitAndSave(MVStore.java:962)
 at org.h2.mvstore.MVStore.commit(MVStore.java:923)
 at org.h2.mvstore.db.TransactionStore.close(TransactionStore.java:217)
 at org.h2.mvstore.db.MVTableEngine$Store.close(MVTableEngine.java:346)
 at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1359)
 at org.h2.engine.Database.close(Database.java:1259)
 at org.h2.engine.Database.removeSession(Database.java:1143)
 at org.h2.engine.Session.close(Session.java:678)
 at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:384)

 We found that a simple null check wasn't sufficient as it messes up the 
 index.

 We instead added a line of code that created a dummy SpatialKey when the 
 given key is null. This works for now but isn't a perfect solution.

 @Override
 public void write(WriteBuffer buff, Object obj) {
 SpatialKey k = (SpatialKey) obj;
 int flags = 0;
 for (int i = 0; i  dimensions; i++) {
 if (k.min(i) == k.max(i)) {
 flags |= 1  i;
 }
 }
 buff.putVarInt(flags);
 for (int i = 0; i  dimensions; i++) {
 buff.putFloat(k.min(i));
 if ((flags  (1  i)) == 0) {
 buff.putFloat(k.max(i));
 }
 }
 buff.putVarLong(k.getId());
 }


 @Override
 public void write(WriteBuffer buff, Object obj) {
 if ( obj == null ){
 obj = new SpatialKey(0,0,0,0,0);
 }
 SpatialKey k = (SpatialKey) obj;
 int flags = 0;
 for (int i = 0; i  dimensions; i++) {
 if (k.min(i) == k.max(i)) {
 flags |= 1  i;
 }
 }
 buff.putVarInt(flags);
 for (int i = 0; i  dimensions; i++) {
 buff.putFloat(k.min(i));
 if ((flags  (1  i)) == 0) {
 buff.putFloat(k.max(i));
 }
 }
 buff.putVarLong(k.getId());
 }


-- 
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/d/optout.


[h2] Re: NULL Geometry index problem

2015-04-07 Thread Nicolas Fortin (OrbisGIS)
Hi,

Thanks for the feedback. I will write a unit test then try to solve the 
issue without writing into the Rtree. (As it could extend the main envelope 
to 0,0)

Regards,

 -- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org



Le mardi 7 avril 2015 13:38:23 UTC+2, John McMahon a écrit :

 We are experiencing null pointer exceptions when we attempt to store a 
 null geometry in H2 when we close the connection

 Attached is a small test.

 org.h2.jdbc.JdbcSQLException: General error: 
 java.lang.NullPointerException [5-186]
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
 at org.h2.message.DbException.get(DbException.java:168)
 at org.h2.message.DbException.convert(DbException.java:295)
 at org.h2.message.DbException.toSQLException(DbException.java:268)
 at org.h2.message.TraceObject.logAndConvert(TraceObject.java:352)
 at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:392)
 at com.intergraph.test.NullGeometryTest.startTest(NullGeometryTest.java:46)
 at com.intergraph.test.NullGeometryTest.main(NullGeometryTest.java:21)
 Caused by: java.lang.NullPointerException
 at org.h2.mvstore.rtree.SpatialDataType.write(SpatialDataType.java:89)
 at org.h2.mvstore.rtree.SpatialDataType.write(SpatialDataType.java:80)
 at org.h2.mvstore.Page.write(Page.java:735)
 at org.h2.mvstore.Page.writeUnsavedRecursive(Page.java:818)
 at org.h2.mvstore.MVStore.storeNowTry(MVStore.java:1057)
 at org.h2.mvstore.MVStore.storeNow(MVStore.java:973)
 at org.h2.mvstore.MVStore.commitAndSave(MVStore.java:962)
 at org.h2.mvstore.MVStore.commit(MVStore.java:923)
 at org.h2.mvstore.db.TransactionStore.close(TransactionStore.java:217)
 at org.h2.mvstore.db.MVTableEngine$Store.close(MVTableEngine.java:346)
 at org.h2.engine.Database.closeOpenFilesAndUnlock(Database.java:1359)
 at org.h2.engine.Database.close(Database.java:1259)
 at org.h2.engine.Database.removeSession(Database.java:1143)
 at org.h2.engine.Session.close(Session.java:678)
 at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:384)

 We found that a simple null check wasn't sufficient as it messes up the 
 index.

 We instead added a line of code that created a dummy SpatialKey when the 
 given key is null. This works for now but isn't a perfect solution.

 @Override
 public void write(WriteBuffer buff, Object obj) {
 SpatialKey k = (SpatialKey) obj;
 int flags = 0;
 for (int i = 0; i  dimensions; i++) {
 if (k.min(i) == k.max(i)) {
 flags |= 1  i;
 }
 }
 buff.putVarInt(flags);
 for (int i = 0; i  dimensions; i++) {
 buff.putFloat(k.min(i));
 if ((flags  (1  i)) == 0) {
 buff.putFloat(k.max(i));
 }
 }
 buff.putVarLong(k.getId());
 }


 @Override
 public void write(WriteBuffer buff, Object obj) {
 if ( obj == null ){
 obj = new SpatialKey(0,0,0,0,0);
 }
 SpatialKey k = (SpatialKey) obj;
 int flags = 0;
 for (int i = 0; i  dimensions; i++) {
 if (k.min(i) == k.max(i)) {
 flags |= 1  i;
 }
 }
 buff.putVarInt(flags);
 for (int i = 0; i  dimensions; i++) {
 buff.putFloat(k.min(i));
 if ((flags  (1  i)) == 0) {
 buff.putFloat(k.max(i));
 }
 }
 buff.putVarLong(k.getId());
 }


-- 
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/d/optout.


[h2] Re: MVStore Update with Pk performance regression.

2015-03-18 Thread Nicolas Fortin (OrbisGIS)
Hi,

Sorry for double post. Mail client issues.

Regards,

Nicolas Fortin

Le vendredi 13 mars 2015 19:45:37 UTC+1, Nicolas Fortin (OrbisGIS) a écrit :

  Hi,

 With H2 1.4.186 we are experimenting a performance decrease between 
 PageStore and MVStore.

 With this sql query:

 drop table if exists test_update_perf;create table test_update_perf(X1 int 
 primary key, X2 double, X3 double) as select X X1, X+150 X2, X*X X3 from 
 SYSTEM_RANGE(0,15000);alter table test_update_perf add column X4 
 double;update test_update_perf set X4 = (X3 - X2);

 H2 MvStore take a lot of time to update rows if they contains a primary 
 key.

 With MVStore

 [image: performance_mvstore.png]

 With PageStore ( good performance)

 [image: performance_pagestore.png]

 I understand that MVStore is currently in Beta. This message is only a 
 feedback on our observation.

 Thanks.

 Regards,
 ​
  
 -- 
 Nicolas Fortin
 IRSTV FR CNRS 2488
 GIShttp://orbisgis.org
 Spatial DB http://h2gis.org
 Noise  http://noisemap.orbisgis.org

 

-- 
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/d/optout.


[h2] MVStore Update with Pk performance regression.

2015-03-13 Thread Nicolas Fortin (OrbisGIS)
 

Hi, 

With H2 1.4.186 we are experimenting a performance decrease between
PageStore and MVStore. 

With this sql query: 

drop table if exists test_update_perf;
create table test_update_perf(X1 int primary key, X2 double, X3 double)
as select X X1, X+150 X2, X*X X3 from SYSTEM_RANGE(0,15000);
alter table test_update_perf add column X4 double;
update test_update_perf set X4 = (X3 - X2);

H2 MvStore take a lot of time to update rows if they contains a primary
key. 

With MVStore 

With PageStore ( good performance) 

I understand that MVStore is currently in Beta. This message is only a
feedback on our observation. 

Thanks. 

Regards, 
​ 

-- 
Nicolas Fortin
IRSTV FR CNRS 2488
GIS http://orbisgis.org
Spatial DB http://h2gis.org
Noise http://noisemap.orbisgis.org
 

-- 
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/d/optout.


Re: [h2] Effective way to retrieve the content of a large table

2015-03-13 Thread Nicolas Fortin (OrbisGIS)
Hi,


At some point, server side cursors will be implemented, then you will just 
 have to run select * from tableName and you are done. This will require 
 some changes however; it can not be supported when using the PageStore. I 
 expect it will take a while until this is available.


Ho great ! But we use h2 95% of time in embedded mode.Cursors will be 
available also in h2 embedded ?

Are you sure the bottleneck is evaluating the condition? That's weird. How 
 did you test it? Do you have a simple test case?


We call hundred of time something like this SELECT * FROM MYTABLE WHERE PK 
IN (? , ? , .. in a prepared statement. I'm not sure if evaluating the 
query condition is the bottleneck of the operation, but I'm talking about 
the overall process of communicating primary keys to engine.

It might be slightly faster to use some internal API, depending on what you 
 want to do with the data. For example, create table ... as select uses a 
 direct API that doesn't buffer rows. Possibly even faster would be to 
 access the MVStore directly (if the data is stored there). But such 
 solutions are harder to maintain, and might not help all that much.


Yes it is a good idea. We could cast dbobjects up to Table and ScanIndex 
interface then use this direct access.

Thanks for your support.

Regards,

-- 

Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org

Le jeudi 12 mars 2015 18:50:11 UTC+1, Thomas Mueller a écrit :

 Hi,

 At some point, server side cursors will be implemented, then you will just 
 have to run select * from tableName and you are done. This will require 
 some changes however; it can not be supported when using the PageStore. I 
 expect it will take a while until this is available.

 we are caching  _ROWID_ or primary keys if available, then query a batch 
 of rows using the keys in the where clause.


 That's what I would do as well.

 This is quite slow as the query condition has to be evaluated by the h2 
 engine.


 Are you sure the bottleneck is evaluating the condition? That's weird. How 
 did you test it? Do you have a simple test case?

 It might be slightly faster to use some internal API, depending on what 
 you want to do with the data. For example, create table ... as select 
 uses a direct API that doesn't buffer rows. Possibly even faster would be 
 to access the MVStore directly (if the data is stored there). But such 
 solutions are harder to maintain, and might not help all that much.

 Regards,
 Thomas



-- 
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/d/optout.


[h2] Re: Move from Google Code to GitHub

2015-03-13 Thread Nicolas Fortin (OrbisGIS)
Hi,

Good news! You will have some Pull Request to read ;)

-Nicolas




-- 
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/d/optout.


[h2] Effective way to retrieve the content of a large table

2015-03-12 Thread Nicolas Fortin (OrbisGIS)
Hi,

We are looking for an effective (fast and minimum memory usage)  way to 
retrieve the data from a large table in H2 1.4.X

What we have done so far:

In order to not reach the fatal MaxMemoryRows we are caching  _ROWID_ or 
primary keys if available, then query a batch of rows using the keys in the 
where clause.

This is quite slow as the query condition has to be evaluated by the h2 
engine.

Do you have any better idea ?

Thanks,

Regards,

-- 

Nicolas Fortin
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org


-- 
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/d/optout.


[h2] Re: Interfaces instead of direct JTS reference

2015-02-05 Thread Nicolas Fortin (OrbisGIS)
Hi Steve,

As your are now familiar with git you can use the H2 git repository to make 
better patch support:

https://github.com/svn2github/H2-Mirror

I will follow your fork and maybe send you some code proposition.

Regards,

Nicolas

Le mercredi 4 février 2015 14:04:04 UTC+1, Steve a écrit :

 some comments from my sid to your suggestions:

- should be in the API package
- you are right!
- wrapper
- I understand your intention behind that... currently I do something 
like that in H2GIS's SpatialResultSetImpl

@Override
public Geometry getGeometry(String columnLabel) throws SQLException
{
Object field = getObject(columnLabel);
if (field == null)
{
return null;
}
if (field instanceof H2Geometry)
{
return ((H2Geometry) field).getJtsGeometry();
}
else
{
throw new SQLException(The column  + columnLabel +  is not a 
Geometry);
}
}

- Default Implementation:
A default implementation itself makes sense because H2 should be able 
to test their spatial index. Therefore I would suggest to implement a 
H2Envelope, H2Geometry, H2GeometryFactory or we can call it JTSEnvelope 
etc... which uses the JTS framework.
The default implementation can be provided by a different jar or by 
H2GIS.

- SysProperties to change the implementation
That could be alternative solution. I suggested the ServiceLoader 

 http://docs.oracle.com/javase/7/docs/api/index.html?java/util/ServiceLoader.htmlbecause
  
of the fact that I'm a fan of that framework :D and 
java.sql.DriverManager 
http://docs.oracle.com/javase/7/docs/api/java/sql/DriverManager.html 
uses also the Service Provider mechanism

- specific geometry types:
I think you need that to support the whole OGC Simple Feature 
Specification for SQL, therefore I understand your need. 
From my point of view is the only necessary step to define additional 
H2 DataTypes. The spatial index and all ohther mechanism's can be the same.



-- 
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/d/optout.


[h2] Re: Interfaces instead of direct JTS reference

2015-02-04 Thread Nicolas Fortin (OrbisGIS)


Hi,

This is a good idea.

Few suggestions:

   - IEnvelope, IGeometryFactory, IGeometry and GeometryParseException 
   should be in the API package of H2. 
   - User defined function should be able to directly reference the wrapped 
   spatial type. Then maybe add two methods like this interface 
   http://docs.oracle.com/javase/7/docs/api/java/sql/Wrapper.html and 
   manager this case when calling user defined function and table function. 
   - H2 should provide itself a default implementation for ease of use 
(stackoverflow 
   question 
   
http://stackoverflow.com/questions/27943435/what-is-the-syntax-for-running-a-spatial-query-in-h2/27949066#27949066).
 
   To change default implementation class you could use sys properties 
   http://www.h2database.com/javadoc/org/h2/engine/SysProperties.html. 
   - Currently all type of geometry are merged together into Geometry type. 
   We should find a way to add a constraint to define for ex. a LINESTRING 
   column that stay LINESTRING column when copying the table. (H2 Domain does 
   not survive when doing 
   
   CREATE TABLE MYTAB AS SELECT THE_GEOM FROM SRCTAB;
   

​

-- 
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/d/optout.


[h2] Re: ResultSet is empty when I move my database file from Windows to Linux environment.

2015-02-04 Thread Nicolas Fortin (OrbisGIS)
Hi,

If you use the H2GIS function FileTable it creates an empty table if the 
linked shape file is not found. If you want to embed the shape file in the 
database you should use SHPREAD instead.

regards,

-Nicolas Fortin

-- 
IRSTV FR CNRS 2488
GIShttp://orbisgis.org
Spatial DB http://h2gis.org
Noise  http://noisemap.orbisgis.org


Le mardi 3 février 2015 18:34:47 UTC+1, IQBAL YUSUF a écrit :

 Hi All,

 I am having a weird problem. I've created a project in Windows 
 environment. When I transfer the project to an Linux CentOS environment 
 ResultSet is coming back empty rows. My code can be viewed from here


 https://github.com/iyusuf/micro-map-service/tree/master/src/main/java/com/sortedset/blog/micromapservice/spring

 Thanks.
 Iqbal


-- 
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/d/optout.


[h2] Re: Interfaces instead of direct JTS reference

2015-02-04 Thread Nicolas Fortin (OrbisGIS)
You can't cast a wrapper to a wrapped object, this is why Java define the 
interface Wrapper.


- - I understand your intention behind that... currently I do 
something like that in H2GIS's SpatialResultSetImpl


Default implementation means without the presence of H2 jar and JTS jar. 
Then at least one implementation of the new Api should be provided by h2. 
You can't ask a user of the database to develop a third party library for a 
feature that are already in h2.


- Default Implementation:
A default implementation itself makes sense because H2 should be able 
to test their spatial index. Therefore I would suggest to implement a 
H2Envelope, H2Geometry, H2GeometryFactory or we can call it JTSEnvelope 
etc... which uses the JTS framework.
The default implementation can be provided by a different jar or by 
H2GIS.

 ​



-- 
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/d/optout.


[h2] Re: Documentation about Geometry type of H2 Database

2015-01-17 Thread Nicolas Fortin (OrbisGIS)
Hello,

Geometry and spatial index need documentation on official h2 documentation 
web site. Maybe h2 team don't see this post ?

Nicolas Fortin
RISING, IRSTV FR CNRS 2488

Le jeudi 29 mai 2014 10:54:05 UTC+2, Nicolas Fortin (OrbisGIS) a écrit :

 Hi,

 I wrote some documentation for H2 website:


 https://github.com/irstv/H2GIS/wiki/Page-for-http:--www.h2database.com-website

 Regards,

 Nicolas Fortin
 RISING, IRSTV FR CNRS 2488


-- 
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/d/optout.


[h2] Issue H2 Parser GROUP BY, 1.4.181 - 1.4.184

2015-01-15 Thread Nicolas Fortin (OrbisGIS)


Hi,

There is a bug with H2 Parser when using group by with the same field name 
as one of select column.

With H2 1.4.181 (OK)

drop table test if exists;create table test(id bigint, neigh bigint, val 
double);insert into test values (1, 2, 15);insert into test values (2, 1, 
10);insert into test values (2, 1 , 5);insert into test values (3, 1, 8);
select a.id, POWER(a.val, sum(b.val)) val from test a,test b group by a.id, 
a.val;

ID 
http://localhost:8082/query.do?jsessionid=397cfddeb3f93ff070507dcb4cf9213e#
VAL 
http://localhost:8082/query.do?jsessionid=397cfddeb3f93ff070507dcb4cf9213e#
14.9143699204177834E44
23.637978807091713E26
32.076918743413931E34
21.0E38

(4 rows, 2 ms)

With H2 1.4.184

 Invalid use of aggregate function SUM(B.VAL); SQL statement:
select a.id, POWER(a.val, sum(b.val)) val from test a,test b group by a.id, 
a.val [90054-184]
org.h2.jdbc.JdbcSQLException: Invalid use of aggregate function SUM(B.VAL); 
SQL statement:
select a.id, POWER(a.val, sum(b.val)) val from test a,test b group by a.id, 
a.val [90054-184]
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.expression.Aggregate.getValue(Aggregate.java:296)
at org.h2.expression.Function.getValueWithArgs(Function.java:1168)
at org.h2.expression.Function.getValue(Function.java:576)
at org.h2.expression.Alias.getValue(Alias.java:36)
at org.h2.command.dml.Select.queryGroup(Select.java:340)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:639)
at org.h2.command.dml.Query.query(Query.java:322)
at org.h2.command.dml.Query.query(Query.java:290)
at org.h2.command.dml.Query.query(Query.java:36)
at org.h2.command.CommandContainer.query(CommandContainer.java:90)
at org.h2.command.Command.executeQuery(Command.java:197)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:79)

The explain is different:

explain select a.id, POWER(a.val, sum(b.val)) val from test a,test b group by 
a.id, a.val;

With H2 1.4.181

SELECT
A.ID,
POWER(A.VAL, SUM(B.VAL)) AS VALFROM PUBLIC.TEST A
/* PUBLIC.TEST.tableScan */INNER JOIN PUBLIC.TEST B
/* PUBLIC.TEST.tableScan */
ON 1=1GROUP BY A.ID, A.VAL

With H2 1.4.184

SELECT
A.ID,
POWER(A.VAL, SUM(B.VAL)) AS VALFROM PUBLIC.TEST A
/* PUBLIC.TEST.tableScan */INNER JOIN PUBLIC.TEST B
/* PUBLIC.TEST.tableScan */
ON 1=1GROUP BY A.ID, POWER(A.VAL, SUM(B.VAL))

I don’t find the commit that change the behavior.

regards,

Nicolas Fortin
IRSTV FR CNRS 2488
​

-- 
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/d/optout.


[h2] Introduced bug in 1.4.183

2014-12-16 Thread Nicolas Fortin (OrbisGIS)
Hi,

Spatial index with default name are ignored in the last release.

The unit test to reproduce the error:

https://github.com/nicolas-f/H2-Mirror/compare/debugspatial
https://github.com/nicolas-f/H2-Mirror/compare/debugspatial.diff
https://github.com/nicolas-f/H2-Mirror/compare/debugspatial.patch

I try line debug but I'm still unable to find the issue.

Thank you

Best regards,

Nicolas Fortin
IRSTV FR CNRS 2488

-- 
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/d/optout.


[h2] Re: Introduced bug in 1.4.183

2014-12-16 Thread Nicolas Fortin (OrbisGIS)
Sorry, the added unit test is wrong. I will fix that.

Nicolas Fortin
IRSTV FR CNRS 2488


Le mardi 16 décembre 2014 15:01:38 UTC+1, Nicolas Fortin (OrbisGIS) a 
écrit :

 Hi,

 Spatial index with default name are ignored in the last release.

 The unit test to reproduce the error:

 https://github.com/nicolas-f/H2-Mirror/compare/debugspatial
 https://github.com/nicolas-f/H2-Mirror/compare/debugspatial.diff
 https://github.com/nicolas-f/H2-Mirror/compare/debugspatial.patch

 I try line debug but I'm still unable to find the issue.

 Thank you

 Best regards,

 Nicolas Fortin
 IRSTV FR CNRS 2488


-- 
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/d/optout.


[h2] Re: Introduced bug in 1.4.183

2014-12-16 Thread Nicolas Fortin (OrbisGIS)
Hi,

ok, the unit test is good now. It fail with r5975 
https://code.google.com/p/h2database/source/detail?r=5975 (release) but 
it pass with r5978 
https://code.google.com/p/h2database/source/detail?r=5978.

It means that you fix also the spatial index with your patch.

Could you please add the spatial unit test ?

Thanks

Nicolas Fortin
IRSTV FR CNRS 2488

Le mardi 16 décembre 2014 15:19:22 UTC+1, Nicolas Fortin (OrbisGIS) a 
écrit :

 Sorry, the added unit test is wrong. I will fix that.

 Nicolas Fortin
 IRSTV FR CNRS 2488


 Le mardi 16 décembre 2014 15:01:38 UTC+1, Nicolas Fortin (OrbisGIS) a 
 écrit :

 Hi,

 Spatial index with default name are ignored in the last release.

 The unit test to reproduce the error:

 https://github.com/nicolas-f/H2-Mirror/compare/debugspatial
 https://github.com/nicolas-f/H2-Mirror/compare/debugspatial.diff
 https://github.com/nicolas-f/H2-Mirror/compare/debugspatial.patch

 I try line debug but I'm still unable to find the issue.

 Thank you

 Best regards,

 Nicolas Fortin
 IRSTV FR CNRS 2488



-- 
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/d/optout.


[h2] Re: MVSTORE db corruption caused by Spatial Index

2014-11-02 Thread Nicolas Fortin (OrbisGIS)
Hi,

Thank you Thomas for the fix. We are waiting the next release in order to 
do more tests with mvstore.

Regards,

Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le mercredi 22 octobre 2014 15:15:51 UTC+2, Nicolas Fortin (OrbisGIS) a 
écrit :

 Hi,

 We (OrbisGIS team) are testing the 1.4.X branch with MVStore. I currently 
 debug a mvstore page corruption where the source may be the spatial index. 

 Here a unit test in order to reproduce the error:

 https://github.com/nicolas-f/H2-Mirror/compare/fix/mvstore_corruption
 https://github.com/nicolas-f/H2-Mirror/compare/fix/mvstore_corruption.diff
 https://github.com/nicolas-f/H2-Mirror/compare/fix/mvstore_corruption.patch

 I would like also to merge org.h2.mvstore.db.MVSpatialIndex and 
 org.h2.index.SpatialTreeIndex into a single class that take an instance of 
 Table in the constructor.

 I will update this thread if I go further in investigation.

 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488


-- 
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/d/optout.


[h2] MVSTORE db corruption caused by Spatial Index

2014-10-22 Thread Nicolas Fortin (OrbisGIS)
Hi,

We (OrbisGIS team) are testing the 1.4.X branch with MVStore. I currently 
debug a mvstore page corruption where the source may be the spatial index. 

Here a unit test in order to reproduce the error:

https://github.com/nicolas-f/H2-Mirror/compare/fix/mvstore_corruption
https://github.com/nicolas-f/H2-Mirror/compare/fix/mvstore_corruption.diff
https://github.com/nicolas-f/H2-Mirror/compare/fix/mvstore_corruption.patch

I would like also to merge org.h2.mvstore.db.MVSpatialIndex and 
org.h2.index.SpatialTreeIndex into a single class that take an instance of 
Table in the constructor.

I will update this thread if I go further in investigation.

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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/d/optout.


Re: [h2] Re: Enhancement on ROW_NUMBER() OVER () and ROWNUM ( )

2014-10-09 Thread Nicolas Fortin (OrbisGIS)
Hi Thomas,

Here a complete example of the difference between Postgre and H2:

[raw]
drop table if exists streets;
create table streets(pk int primary key, length real);
insert into streets values (5, 55.2), (7, 33.2), (9, 151.1), (15, 48.2), 
(20, 14.6);
update streets set length = 60 where pk = 5;

H2:
Execute request 5/6: select rowcpt, pk, length from (select ROW_NUMBER() 
OVER () rowcpt, pk ,length from streets) streetscount where length  40

ROWCPT(INTEGER)PK(INTEGER)
LENGTH(REAL)   
1  5  
60 
2  9  151,1
3  15 48,2

Execute request 6/6: select * from streets

PK(INTEGER)LENGTH(REAL)   
5  60 
7  33,2
9  151,1
15 48,2
20 14,6

Postgre:

Execute request 5/6: select rowcpt, pk, length from (select ROW_NUMBER() 
OVER () rowcpt, pk ,length from streets) streetscount where length  40

rowcpt(int8)   pk(int4)   
length(float4) 
2  9  151,1
3  15 48,2
5  5  
60 

Execute request 6/6: select * from streets

pk(int4)   length(float4) 
7  33,2
9  151,1
15 48,2
20 14,6
5  60   
[/raw]

If a show a table of the full content of streets, thanks to Postgre without 
caching primary key I could highlight the first, third and fourth lines.

Following the result of select * from streets, I expect h2 returning 
rowcpt 1,3,4

We have decided to cache primary key (take time and memory for big table) 
in order to bypass this problem.

Thanks for support.

- Nicolas
IRSTV FR CNRS 2488

Le jeudi 9 octobre 2014 07:52:38 UTC+2, Thomas Mueller a écrit :

 Hi,

 I'm not sure if I understand. You basically need a row id, which uniquely 
 identifies a row within a table? H2 supports the _rowid_ column (like 
 SQLite). Wouldn't that be enough for you? Is the problem that the syntax 
 (when using _rowid_) would be different to PostgreSQL?

 Maybe it's easier if you could provide a complete example (as small as 
 possible, but including create table and insert statements), that shows 
 what you need.

 Regards,
 Thomas






 On Wed, Oct 8, 2014 at 4:50 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 To go further I have to find a way to guess if TopTableFilter belongs to 
 another preparedStatement. The only difference that I found is the 
 Select.command is null in sub query.

 -- 
 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.com 
 javascript:.
 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+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/d/optout.


[h2] Re: Spatial for H2 gone?

2014-10-09 Thread Nicolas Fortin (OrbisGIS)
Hi,

This link is dead. H2 Spatial has been renamed into H2GIS http://h2gis.org
.

Best regards,

Nicolas
Atelier SIG
IRSTV FR CNRS 2488

Le jeudi 9 octobre 2014 15:25:07 UTC+2, David Williams a écrit :


 All,

 This link is on the H2 home page but it's a bad link. Where is the H2 
 Spatial Products?

 H2 Spatial: spatial functions to H2 database 
 http://geosysin.iict.ch/irstv-trac/wiki/H2spatial/Download

 Thanks
 David



-- 
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/d/optout.


[h2] Enhancement on ROW_NUMBER() OVER () and ROWNUM ( )

2014-10-08 Thread Nicolas Fortin (OrbisGIS)
Hi,

This is *far for being finished* but I'm working on the function 
ROW_NUMBER( ) OVER( ) and ROWNUM() in order to handle it the same way as 
PostGreSQL. I post it here before going further because I want to know if 
such patch when done have a change to be merged or not.

The idea is to be able to retrieve original row number when using ROWNUM( ) 
in a sub-request. The the following line in document would be removed 
(even when the  index conditions are specified in an outer query)

Sample with Postgre:
raw
create index on london.osm-line(highway)
select ROW_ID, highway from (select ROW_NUMBER() OVER () ROW_ID,* from 
london.osm-line) as d where d.highway = 'footway' limit 5;

row_id(int8)   highway(varchar)   
3  footway
10 footway
11 footway
13 footway
20 footway  
/raw

The *first try* of the patch is here, but it return the original index 
without using sub-request, and it is not expected.

https://github.com/nicolas-f/H2-Mirror/commit/7e68a515c2f02e45f890203e1f5e5182a6953606

-Nicolas
IRSTV FR CNRS 2488

-- 
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/d/optout.


[h2] Re: Enhancement on ROW_NUMBER() OVER () and ROWNUM ( )

2014-10-08 Thread Nicolas Fortin (OrbisGIS)
To go further I have to find a way to guess if TopTableFilter belongs to 
another preparedStatement. The only difference that I found is the 
Select.command is null in sub query.

-- 
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/d/optout.


[h2] Re: Git repo request

2014-10-06 Thread Nicolas Fortin (OrbisGIS)
The main advantage of a git repository over a svn repository is the offline 
commit and the branching feature.

Thanks to git Thomas could maintain 1.3.X(regular) and 1.4.X(mvstore) 
branch by applying the same patch (git cherry-pick) easily.

Google code manage svn and/or git:
https://code.google.com/p/support/wiki/ConvertingSvnToGit

But this is true that learning Git require time.

-Nicolas

-- 
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/d/optout.


[h2] Re: Git repo request

2014-10-05 Thread Nicolas Fortin (OrbisGIS)
Hi,

There is H2 git mirror repository:

https://github.com/svn2github/H2-Mirror

There is however some delay. You can use git svn command in order to 
update to the last commit.

When your branch is ready you can post the link using this feature:

https://github.com/nicolas-f/H2-Mirror/compare/trigger_test.diff
https://github.com/nicolas-f/H2-Mirror/compare/trigger_test.patch

-Nicolas

Le lundi 28 mars 2011 11:20:34 UTC+2, dector a écrit :

 Hello! I like H2 very much! Also I like and use git. I failed to 
 convert svn repository to git repo, so I downloaded sources and push 
 them to github. 

 BUT It would be very great if you'll publish h2 sources in git repo 
 (using github). And I'll delete my unofficial repo and will fork your 
 github repo. I would like to read sources and try to make few commits. 

 Thanks! 

 PS. My commit message means, that I there is not my project. And I 
 don't start independent development.

-- 
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/d/optout.


Re: [h2] H2 1.4.181 system column _ROWID_ slow with MVSTORE

2014-09-04 Thread Nicolas Fortin (OrbisGIS)
Hi,

Thanks for the patch Thomas. I will test it as soon as the snapshot build 
will be available.

-Nicolas

Le mercredi 3 septembre 2014 10:16:21 UTC+2, Nicolas Fortin (OrbisGIS) a 
écrit :

 Hi,

 Nice thank you !

 We will give you more feedback later about the beta version of h2.

 Regards,
 Nicolas Fortin
 Atelier SIG, IRSTV FR CNRS 2488
 http://github.com/nicolas-f

 Le mercredi 3 septembre 2014 07:44:58 UTC+2, Thomas Mueller a écrit :

 Hi,

 Yes, this is possible. It looks like there is no special test case for 
 this feature, that's why it's not yet implemented for the MVStore. I will 
 fix that.

 Regards,
 Thomas



 On Tuesday, September 2, 2014, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 Using H2 1.4.181 (2014-08-06):

 Creating a huge table (118mb):
 raw
 create table mytable as select 
 REPEAT(hash('SHA256',STRINGTOUTF8((rand()+X)::varchar),1),2) field from 
 SYSTEM_RANGE(1, 40);
 /raw
 Then request only one row using _ROWID_
 raw
 select * from MYTABLE where _ROWID_ = 1
 /raw
 It took 437 ms

 It seems that MVStore check all row, and is not using internal storage 
 index as claimed in documentation.

 Our software OrbisGIS use this row identifier in order to speed-up the 
 rendering of the table when Pk is not available.

 Can you speed-up the _ROWID_ column query with mvstore, as it is with 
 regular table ?

 Thanks for reading

 Regards,

 -Nicolas Fortin
 Atelier SIG, IRSTV FR CNRS 2488
 http://github.com/nicolas-f



-- 
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/d/optout.


Re: [h2] H2 1.4.181 system column _ROWID_ slow with MVSTORE

2014-09-03 Thread Nicolas Fortin (OrbisGIS)
Hi,

Nice thank you !

We will give you more feedback later about the beta version of h2.

Regards,
Nicolas Fortin
Atelier SIG, IRSTV FR CNRS 2488
http://github.com/nicolas-f

Le mercredi 3 septembre 2014 07:44:58 UTC+2, Thomas Mueller a écrit :

 Hi,

 Yes, this is possible. It looks like there is no special test case for 
 this feature, that's why it's not yet implemented for the MVStore. I will 
 fix that.

 Regards,
 Thomas



 On Tuesday, September 2, 2014, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 Using H2 1.4.181 (2014-08-06):

 Creating a huge table (118mb):
 raw
 create table mytable as select 
 REPEAT(hash('SHA256',STRINGTOUTF8((rand()+X)::varchar),1),2) field from 
 SYSTEM_RANGE(1, 40);
 /raw
 Then request only one row using _ROWID_
 raw
 select * from MYTABLE where _ROWID_ = 1
 /raw
 It took 437 ms

 It seems that MVStore check all row, and is not using internal storage index 
 as claimed in documentation.

 Our software OrbisGIS use this row identifier in order to speed-up the 
 rendering of the table when Pk is not available.

 Can you speed-up the _ROWID_ column query with mvstore, as it is with 
 regular table ?

 Thanks for reading

 Regards,

 -Nicolas Fortin
 Atelier SIG, IRSTV FR CNRS 2488
 http://github.com/nicolas-f



-- 
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/d/optout.


[h2] H2 1.4.181 system column _ROWID_ slow with MVSTORE

2014-09-02 Thread Nicolas Fortin (OrbisGIS)


Hi,

Using H2 1.4.181 (2014-08-06):

Creating a huge table (118mb):
raw
create table mytable as select 
REPEAT(hash('SHA256',STRINGTOUTF8((rand()+X)::varchar),1),2) field from 
SYSTEM_RANGE(1, 40);
/raw
Then request only one row using _ROWID_
raw
select * from MYTABLE where _ROWID_ = 1
/raw
It took 437 ms

It seems that MVStore check all row, and is not using internal storage index as 
claimed in documentation.

Our software OrbisGIS use this row identifier in order to speed-up the 
rendering of the table when Pk is not available.

Can you speed-up the _ROWID_ column query with mvstore, as it is with regular 
table ?

Thanks for reading

Regards,

-Nicolas Fortin
Atelier SIG, IRSTV FR CNRS 2488
http://github.com/nicolas-f

-- 
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/d/optout.


[h2] Re: custom Aggregate Function request rows more than once

2014-06-18 Thread Nicolas Fortin (OrbisGIS)
Hi,

H2 call the function multiple times on order to retrieve column list. 

There is a way to detect when only column list is necessary:
https://github.com/irstv/H2GIS/blob/master/h2spatial/src/main/java/org/h2gis/h2spatial/TableFunctionUtil.java#L67

See: https://groups.google.com/forum/#!topic/h2-database/NHH0rDeU258

Regards,

Nicolas Fortin
IRSTV CNRS 2488



Le mardi 17 juin 2014 17:13:25 UTC+2, Stam Christoforidis a écrit :

 Hi,

 I used the interface org.h2.api.AggregateFunction to implement a custom 
 aggregate function.
 However in case a group of edges is too large, the structures where i save 
 some values from
 the rows of a specific group may not fit into main memory. In my 
 application all rows of a group should
 be iterated in order to produce the result. 
 Is there any way to implement such kind of operation on H2? 


-- 
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/d/optout.


[h2] Fix on cost hint computation with MVSpatialIndex and SpatialTreeIndex

2014-05-13 Thread Nicolas Fortin (OrbisGIS)
Hi,

I found an error with Index cost hint computation on spatial index. 
ScanIndex give wrong cost if _rowid_ is used, H2 use the next available 
index.

Please see this issue for more information:
https://github.com/irstv/orbisgis/issues/662

Patch is done in the Spatial Index side:
https://github.com/nicolas-f/H2-Mirror/compare/fix;spatial_index
https://github.com/nicolas-f/H2-Mirror/compare/fix;spatial_index.patch
https://github.com/nicolas-f/H2-Mirror/compare/fix;spatial_index.diff

The fix could be done alternatively on the ScanIndex.getCost() by checking 
usage of  _rowid_ .

Thanks

Best regards,

Nicolas Fortin
RISING IRSTV FR CNRS 2488
http://www.h2gis.org

-- 
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/d/optout.


[h2] DataBaseMetaData#getProcedureColumns missing return column

2014-05-05 Thread Nicolas Fortin (OrbisGIS)
Hi,

In the current state of H2 1.4.17, there is no way to retrieve procedure 
return type. However JDBC Api of DataBaseMetaData#getProcedureColumns 
specify that *ORDINAL_POSITION* at 0 mean return value of procedure. 
PostGreSQL follow JDBC Api for this point.

Here the patch in order to return the return type of procedures:

https://github.com/nicolas-f/H2-Mirror/compare/meta_procedures
https://github.com/nicolas-f/H2-Mirror/compare/meta_procedures.diff
https://github.com/nicolas-f/H2-Mirror/compare/meta_procedures.patch

There is some duplicated lines in the patch. I prefer to leave it as is for the 
sake of diff clarity.

I would like to see the patch applied to 1.3.X but as SVN does not support 
branch it is impossible..

Thanks for support.

Best regards,

Nicolas Fortin,
RISING FR IRSTV 2488

-- 
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/d/optout.


[h2] ValueGeometry important small change

2014-04-02 Thread Nicolas Fortin (OrbisGIS)
Hi,

I missed that for a long time. In order to see the Z coordinate in H2 we 
have only to replace the following function in ValueGeometry.java:

/**
  * Get the value in Well-Known-Text format.
  *
  * @return the well-known-text
  */
 public String getWKT() {
 return new WKTWriter().write(getGeometryNoCopy());
 }


By this

/**
  * Get the value in Well-Known-Text format.
  *
  * @return the well-known-text
  */
 public String getWKT() {
 return new WKTWriter(*3*).write(getGeometryNoCopy());
 }


 
*2* is the default dimension output of WKTWriter. 

Unlike WKBWriter we don't have to check for dimension because WKTWriter 
will not write Z if Z is NaN.

Thank you,

Regards,

-Nicolas Fortin
RISING, IRSTV FR CNRS 2488

-- 
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/d/optout.


Re: [h2] Fix Variable arguments on table function

2014-03-31 Thread Nicolas Fortin (OrbisGIS)
Hi,

Thank you for the merge.


Regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/


Le lundi 31 mars 2014 16:07:07 UTC+2, Noel Grandin a écrit :

 Just noting that this patch has been pushed. 

 On 2014-03-26 10:40, Nicolas Fortin (OrbisGIS) wrote: 
  
  I wrote a patch in order to fix a bug with var arguments. Table function 
 is called with the wrong number of arguments 
  (the first and second call only) if it requires var arguments. 


-- 
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/d/optout.


[h2] Important fix on ValueGeometry

2014-03-28 Thread Nicolas Fortin (OrbisGIS)
Hi,

We were stuck on a failing unit test for two days on H2GIS. Then we 
understood that we were changing a geometry in-place. In conjunction with 
the object cache, a WKB hash of a ValueGeometry does not fit with the 
mutated Geometry instance.

This fix simply return a Geometry clone when the user do rs.getObject( )

https://github.com/nicolas-f/H2-Mirror/compare/fix;FixGeometryMutationCache
https://github.com/nicolas-f/H2-Mirror/compare/fix;FixGeometryMutationCache.diff
https://github.com/nicolas-f/H2-Mirror/compare/fix;FixGeometryMutationCache.patch

Regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/

-- 
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/d/optout.


Re: [h2] Important fix on ValueGeometry

2014-03-28 Thread Nicolas Fortin (OrbisGIS)
Hi,

Nice, thank you. With git instead of svn, merging is easier.

There is another patch also, you can wait that svn2github synchronise your 
commits before applying the following patch:

https://github.com/nicolas-f/H2-Mirror/compare/fix;TableFunctionVarArgs
https://github.com/nicolas-f/H2-Mirror/compare/fix;TableFunctionVarArgs.patch
https://github.com/nicolas-f/H2-Mirror/compare/fix;TableFunctionVarArgs.diff

Regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/

Le vendredi 28 mars 2014 16:01:18 UTC+1, Thomas Mueller a écrit :

 Hi,

 Your patch is now committed. (I had to change it a bit because I couldn't 
 apply it directly).

 Regards,
 Thomas




-- 
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/d/optout.


[h2] Fix Variable arguments on table function

2014-03-26 Thread Nicolas Fortin (OrbisGIS)
Hi,

I wrote a patch in order to fix a bug with var arguments. Table function is 
called with the wrong number of arguments (the first and second call only) 
if it requires var arguments.

https://github.com/nicolas-f/H2-Mirror/compare/fix;TableFunctionVarArgs
https://github.com/nicolas-f/H2-Mirror/compare/fix;TableFunctionVarArgs.patch
https://github.com/nicolas-f/H2-Mirror/compare/fix;TableFunctionVarArgs.diff

Regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/

-- 
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/d/optout.


Re: [h2] OSGi Manifest for H2 snapshot

2014-03-24 Thread Nicolas Fortin (OrbisGIS)
Hi,

Yes the - is a problem, I try it. The provided manifest works.

Implementation-Version is the same as pom version:

http://maven.apache.org/maven-1.x/plugins/jar/manifest.html

Regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/

Le samedi 22 mars 2014 17:55:47 UTC+1, Thomas Mueller a écrit :

 Hi,

 I thought Maven uses -SNAPSHOT, so I assumed OSGi does as well. Somebody 
 told me - before the SNAPSHOT was a problem for Apache Felix but is now 
 solved. Are you sure - is a problem? If yes, would it be better to use 
 .SNAPSHOT everywhere? What about .snapshot (lowercase)?

 Regards,
 Thomas



 On Thu, Mar 20, 2014 at 9:20 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 Great ! Only Implementation-Version support the - character. Other 
 attributes must use dot instead 1.3.176.SNAPSHOT

 I don't know if it is complicated to deploy snapshot on maven central. I 
 follow this file to do release for h2gis but I do not automated the 
 process. 
 https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide?__utma=246996102.1370845598.1382454439.1382454439.1382454439.1__utmb=246996102.4.10.1382454439__utmc=246996102__utmx=-__utmz=246996102.1382454439.1.1.utmcsr=google|utmccn=%28organic%29|utmcmd=organic|utmctr=%28not%20provided%29__utmv=-__utmk=245989639#SonatypeOSSMavenRepositoryUsageGuide-7a.2.PublishSnapshotshttps://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide?__utma=246996102.1370845598.1382454439.1382454439.1382454439.1__utmb=246996102.4.10.1382454439__utmc=246996102__utmx=-__utmz=246996102.1382454439.1.1.utmcsr=google%7Cutmccn=%28organic%29%7Cutmcmd=organic%7Cutmctr=%28not%20provided%29__utmv=-__utmk=245989639#SonatypeOSSMavenRepositoryUsageGuide-7a.2.PublishSnapshots

 We currently use H2 trunk in H2GIS.

 Regards,

 Nicolas Fortin
 RISING team
 CNRS - Ecole Centrale de Nantes
 BP 92101
 1 rue de la Noë, 44321 NANTES Cedex 3
 France
 http://www.ec-nantes.fr/

 Le jeudi 20 mars 2014 07:53:27 UTC+1, Thomas Mueller a écrit :

 Hi,

 You are adding -SNAPSHOT to the version. Was there any other change? I 
 will try to change the build so that all h2-latest are automatically 
 snapshot versions.

 Regards,
 Thomas

  -- 
 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/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+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/d/optout.


Re: [h2] OSGi Manifest for H2 snapshot

2014-03-20 Thread Nicolas Fortin (OrbisGIS)
Hi,

Great ! Only Implementation-Version support the - character. Other 
attributes must use dot instead 1.3.176.SNAPSHOT

I don't know if it is complicated to deploy snapshot on maven central. I 
follow this file to do release for h2gis but I do not automated the 
process. 
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide?__utma=246996102.1370845598.1382454439.1382454439.1382454439.1__utmb=246996102.4.10.1382454439__utmc=246996102__utmx=-__utmz=246996102.1382454439.1.1.utmcsr=google|utmccn=%28organic%29|utmcmd=organic|utmctr=%28not%20provided%29__utmv=-__utmk=245989639#SonatypeOSSMavenRepositoryUsageGuide-7a.2.PublishSnapshots

We currently use H2 trunk in H2GIS.

Regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/

Le jeudi 20 mars 2014 07:53:27 UTC+1, Thomas Mueller a écrit :

 Hi,

 You are adding -SNAPSHOT to the version. Was there any other change? I 
 will try to change the build so that all h2-latest are automatically 
 snapshot versions.

 Regards,
 Thomas


-- 
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/d/optout.


Re: [h2] Re: Patch for Column constraint in View

2014-03-15 Thread Nicolas Fortin (OrbisGIS)
Hi,

Thank you very appreciated.

regards,

Nicolas Fortin
RISING team
CNRS - Ecole Centrale de Nantes
BP 92101
1 rue de la Noë, 44321 NANTES Cedex 3
France
http://www.ec-nantes.fr/

Le samedi 15 mars 2014 14:25:24 UTC+1, Thomas Mueller a écrit :

 Hi,

 Sorry for the delay. I have now committed your patch (I changed the 
 formatting slightly).

 Regards,
 Thomas


 On Thu, Mar 13, 2014 at 9:02 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 Any feedback about the patch ?

 Thanks


 -Nicolas Fortin
 Atelier SIG, IRSTV CNRS FR 2488

 Le mardi 4 mars 2014 11:17:04 UTC+1, Nicolas Fortin (OrbisGIS) a écrit :

 Hi,

 In the current version of H2 column constraints are lost when we create 
 a View of these columns. In H2GIS constraints information are vital in 
 order to publish geometry column information.

 This patch read the check constraint on columns when create a view. 
 Support is for ExpressionColumn and for Alias than encapsulate an 
 ExpressionColumn. I hope the code coverage is sufficient.

 https://github.com/nicolas-f/H2-Mirror/compare/column_
 constraints_in_view
 https://github.com/nicolas-f/H2-Mirror/compare/column_
 constraints_in_view.diff
 https://github.com/nicolas-f/H2-Mirror/compare/column_
 constraints_in_view.patch

 Thank you for support

 -Nicolas Fortin
 Atelier SIG, IRSTV CNRS FR 2488

  -- 
 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/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+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/d/optout.


[h2] OSGi Manifest for H2 snapshot

2014-03-14 Thread Nicolas Fortin (OrbisGIS)
Hi,

I work on how to define a valid snapshot release manifest for H2. It should 
be used in the release of h2-latest.jar


The result is here:

Manifest-Version: 1.0
 Implementation-Title: H2 Database Engine
 Implementation-URL: http://www.h2database.com
 Implementation-Version: 1.3.176-SNAPSHOT
 Build-Jdk: 1.6
 Created-By: 1.6.0_27-b27 (Sun Microsystems Inc.)
 Main-Class: org.h2.tools.Console
 Bundle-Activator: org.h2.util.DbDriverActivator
 Bundle-ManifestVersion: 2
 Bundle-Name: H2 Database Engine
 Bundle-SymbolicName: org.h2
 Bundle-Vendor: H2 Group
 Bundle-Version: 1.3.176.SNAPSHOT
 Bundle-License: http://www.h2database.com/html/license.html
 Bundle-Category: jdbc
 Import-Package: javax.management,
  javax.naming;resolution:=optional,
  javax.naming.spi;resolution:=optional,
  javax.net,
  javax.net.ssl,
  javax.servlet;resolution:=optional,
  javax.servlet.http;resolution:=optional,
  javax.sql,
  javax.tools;resolution:=optional,
  javax.transaction.xa;resolution:=optional,
  org.apache.lucene.analysis;version=[3.0.0,3.1.0);resolution:=optional,

  
 org.apache.lucene.analysis.standard;version=[3.0.0,3.1.0);resolution:=optional,
  org.apache.lucene.document;version=[3.0.0,3.1.0);resolution:=optional,
  org.apache.lucene.index;version=[3.0.0,3.1.0);resolution:=optional,

  org.apache.lucene.queryParser;version=[3.0.0,3.1.0);resolution:=optional,
  org.apache.lucene.search;version=[3.0.0,3.1.0);resolution:=optional,
  org.apache.lucene.store;version=[3.0.0,3.1.0);resolution:=optional,
  org.apache.lucene.util;version=[3.0.0,3.1.0);resolution:=optional,
  com.vividsolutions.jts.geom;version=1.13;resolution:=optional,
  com.vividsolutions.jts.io;version=1.13;resolution:=optional,
  org.h2;version=[1.3,1.4.0),
  org.h2.api;version=[1.3,1.4.0),
  org.h2.fulltext;version=[1.3,1.4.0),
  org.h2.jdbcx;version=[1.3,1.4.0),
  org.h2.tools;version=[1.3,1.4.0),
  org.h2.util;version=[1.3,1.4.0),
  org.h2.value;version=[1.3,1.4.0),
  org.osgi.framework;version=1.5,
  org.osgi.service.jdbc;version=1.0,
  org.slf4j;version=[1.6.0,1.7.0);resolution:=optional
 Export-Package: org.h2;version=1.3.176.SNAPSHOT,
  org.h2.api;version=1.3.176.SNAPSHOT,
  org.h2.constant;version=1.3.176.SNAPSHOT,
  org.h2.fulltext;version=1.3.176.SNAPSHOT,
  org.h2.jdbc;version=1.3.176.SNAPSHOT,
  org.h2.jdbcx;version=1.3.176.SNAPSHOT,
  org.h2.tools;version=1.3.176.SNAPSHOT,
  org.h2.util;version=1.3.176.SNAPSHOT,
  org.h2.value;version=1.3.176.SNAPSHOT,
  org.h2.bnf;version=1.3.176.SNAPSHOT ,
  org.h2.bnf.context;version=1.3.176.SNAPSHOT
 Premain-Class: org.h2.util.Profiler


Thanks for reading

-Nicolas Fortin
Atelier SIG, IRSTV FR CNRS 2488

-- 
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/d/optout.


[h2] Re: Patch for Column constraint in View

2014-03-13 Thread Nicolas Fortin (OrbisGIS)
Hi,

Any feedback about the patch ?

Thanks

-Nicolas Fortin
Atelier SIG, IRSTV CNRS FR 2488

Le mardi 4 mars 2014 11:17:04 UTC+1, Nicolas Fortin (OrbisGIS) a écrit :

 Hi,

 In the current version of H2 column constraints are lost when we create a 
 View of these columns. In H2GIS constraints information are vital in order 
 to publish geometry column information.

 This patch read the check constraint on columns when create a view. 
 Support is for ExpressionColumn and for Alias than encapsulate an 
 ExpressionColumn. I hope the code coverage is sufficient.

 https://github.com/nicolas-f/H2-Mirror/compare/column_constraints_in_view

 https://github.com/nicolas-f/H2-Mirror/compare/column_constraints_in_view.diff

 https://github.com/nicolas-f/H2-Mirror/compare/column_constraints_in_view.patch

 Thank you for support

 -Nicolas Fortin
 Atelier SIG, IRSTV CNRS FR 2488


-- 
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/d/optout.


[h2] Patch for Column constraint in View

2014-03-04 Thread Nicolas Fortin (OrbisGIS)
Hi,

In the current version of H2 column constraints are lost when we create a 
View of these columns. In H2GIS constraints information are vital in order 
to publish geometry column information.

This patch read the check constraint on columns when create a view. Support 
is for ExpressionColumn and for Alias than encapsulate an ExpressionColumn. 
I hope the code coverage is sufficient.

https://github.com/nicolas-f/H2-Mirror/compare/column_constraints_in_view
https://github.com/nicolas-f/H2-Mirror/compare/column_constraints_in_view.diff
https://github.com/nicolas-f/H2-Mirror/compare/column_constraints_in_view.patch

Thank you for support

-Nicolas Fortin
Atelier SIG, IRSTV CNRS FR 2488

-- 
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 1.3.175, predicate with view table throwing Java Heap Space

2014-02-26 Thread Nicolas Fortin (OrbisGIS)
Hi Thomas,

Great ! Spatial index in view, and better client/server performance. Thank 
you, I will test it tomorrow. It should be okay for byte array. Can't wait 
for the next release of H2 ;)

-Nicolas Fortin
Atelier SIG, IRSTV FR CNRS 2488
http://www.h2gis.org

Le mercredi 26 février 2014 19:43:16 UTC+1, Thomas Mueller a écrit :

 Hi,

 The patch from Nicolas also broke TestSpatial.testValueGeometryScript when 
 running in server mode, but it's actually a good thing that this test 
 broke, as it revealed a problem when transferring geometry values: so far, 
 the text representation was transferred, which is not optimal (and 
 incorrect in this case). I changed it to transfer the byte array instead. I 
 also refactored the geometry value class a bit, to always keep the byte 
 array (so far it was always generated, but only sometimes kept). I assume 
 the addition memory usage is OK(?)

 I also found a way to use spatial indexes in views. It's still not 
 perfect, but anyway I want to re-work query processing at some point.

 Regards,
 Thomas
  


-- 
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.


[h2] H2 1.3.175, predicate with view table throwing Java Heap Space

2014-02-25 Thread Nicolas Fortin (OrbisGIS)
Hi,

I'm asking for help in order to find a fix for the following issue.

When I use the  predicate with a view table H2 version 1.3.175 raise a 
Java Heap space ( take more than 1gb memory)

Here the SQL in order to reproduces this issue:

https://gist.github.com/nicolas-f/9206451

JTS library has to be in the classpath.

Thanks in advance for help.

Regards,

-Nicolas Fortin
Atelier SIG; IRSTV FR CNRS 2488

-- 
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 1.3.175, predicate with view table throwing Java Heap Space

2014-02-25 Thread Nicolas Fortin (OrbisGIS)
Hi Thomas,

Thank you for the hint. The patch is ready but maybe you could just do an 
else statement that increment the variable i.

https://github.com/nicolas-f/H2-Mirror/compare/fix_view_index_spatial
https://github.com/nicolas-f/H2-Mirror/compare/fix_view_index_spatial.patch
https://github.com/nicolas-f/H2-Mirror/compare/fix_view_index_spatial.diff

I've also added a ValueGeometry.toSQL fix.

-Nicolas Fortin
Atelier SIG, IRSTV FR CNRS 2488

-- 
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] Re: Two more fix patch for H2 Database

2014-02-11 Thread Nicolas Fortin (OrbisGIS)
Hi Thomas,

Here is a new patch that takes account of your advice:

https://github.com/nicolas-f/H2-Mirror/compare/h2-fork-r5473
https://github.com/nicolas-f/H2-Mirror/compare/h2-fork-r5473.patch
https://github.com/nicolas-f/H2-Mirror/compare/h2-fork-r5473.diff

Thanks for your help

-Nicolas
Atelier SIG, IRSTV FR CNRS 2488

Le jeudi 30 janvier 2014 08:36:51 UTC+1, Thomas Mueller a écrit :

 Hi,

 The patch is good, thanks a lot! The only change I have in mind (but I can 
 do that) is to change the names of the interfaces. Currently you have:

 AggregateAlias (new base interface)
 AggregateFunction extends AggregateAlias (the current interface, 
 deprecated)
 AggregateTypeFunction extends AggregateAlias (new interface)

 Maybe it's easier to not use a base interface (not use AggregateAlias), 
 but deprecate the old interface (AggregateFunction), and create a new 
 interface and simply call that one Aggregate. An implementation could 
 support both interfaces, in which case H2 would use Aggregate (the new 
 version).

 What do you think?

 Regards,
 Thomas


-- 
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] how to compile source

2014-01-28 Thread Nicolas Fortin (OrbisGIS)
Hi,

You have removed all unit test and you do not use maven central for 
dependencies. Moreover, there is only one maven h2 project. Packages should 
be splited into multiple h2 maven sub-project depending on packages 
dependencies. We should use maven profiles to enable/disable extensive 
(memory/disk usage cost) unit test .

Some sub modules sample:
H2CONSTANT
H2TOOLS
H2MESSAGES
H2API
MVMAP
BNF (sql parser, auto completion)
MVSTORE

Doing this will give access to Travis (compilation+test), Sonar (test code 
coverage, code hints), easy deployment on central repository.

However it require a significant amount of work. Then I will contribute 
only if Thomas is interested in.

-Nicolas
Atelier SIG, IRSTV FR CNRS 2488

Le mardi 28 janvier 2014 10:41:12 UTC+1, jpgf...@gmail.com a écrit :

 Hi.

 There is the H2 module.

 Just for my personnal comprehension why are you not interested to Mavenize ?
 I'm curious in what can be the disanvantage of a mavenize project.
 I'm hope it will be helpful to yuo to generate a new version of h2.

 Regards,

 JPG




-- 
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] Re: Two more fix patch for H2 Database

2014-01-28 Thread Nicolas Fortin (OrbisGIS)
Hi,

Does this patch require more modifications to be accepted ? I will try to 
not miss the next h2 release in order to release a new H2GIS version on 
maven central.

Thank you

Regards,

Nicolas Fortin
Atelier SIG, IRSTV FR CNRS 2488

Le mardi 21 janvier 2014 11:13:25 UTC+1, Nicolas Fortin (OrbisGIS) a écrit :

 Hi,

 As you requested I commit something about user defined aggregate function. 
 A new interface use H2 internal type codes instead of sql type codes.

 https://github.com/nicolas-f/H2-Mirror/compare/h2-fork-r5429
 https://github.com/nicolas-f/H2-Mirror/compare/h2-fork-r5429.diff
 https://github.com/nicolas-f/H2-Mirror/compare/h2-fork-r5429.patch

 Thank you

 Regards,

 Nicolas Fortin
 Atelier SIGn; IRSTV FR CNRS 2488


-- 
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] MvStore exception Corrupt page count

2014-01-25 Thread Nicolas Fortin (OrbisGIS)
Hi,

Nice, thank you for this fix.

-Nicolas
Atelier SIG, FR CNRS 2488

Le vendredi 24 janvier 2014 16:01:11 UTC+1, Thomas Mueller a écrit :

 Hi,

 This is now fixed in the trunk. It was a bug in the R-Tree implementation: 
 when overwriting existing entries in the index, a page would be freed up 
 multiple times. It does not affect in-memory indexes.

 Regards,
 Thomas



 On Thu, Jan 23, 2014 at 9:24 PM, Thomas Mueller 
 thomas.to...@gmail.comjavascript:
  wrote:

 Hi,

 Yes, I can reproduce it. I assume it's a bug in the R-Tree 
 implementation. I have shortened the test case to:

 drop all objects;
 create table coords as select rand()*50 x, rand()*50 y from 
 system_range(1, 5000);
 create table geoms(id identity, the_geom geometry);
 create spatial index on geoms(the_geom);
 insert into geoms(the_geom) select 'polygon(('||(1+x)||' '||(1+y)||', '||
 (2+x)||' '||(2+y)||', '||(3+x)||' '||(1+y)||', '||(1+x)||' '||(1+y)||'))' 
 from coords;

 Regards,
 Thomas
  

 On Thu, Jan 23, 2014 at 10:56 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 Using H2 Version 1.3.175 (2014-01-18) with options 
 ;MV_STORE=TRUE;MVCC=TRUE. There is a problem with spatial index when I is 
 used in combination with mvstore. To following sql requests lead to an 
 exception:

 create table coords as select (RAND() * 50 ) X, (RAND() * 50 ) Y from 
 system_range(1, 2);

 create table geoms (id integer primary key auto_increment, the_geom 
 geometry);
 create spatial index on geoms(the_geom);
 insert into GEOMS(the_geom) select ('POLYGON((' || (1 + X)::varchar || ' 
 ' || (1 + Y )::varchar || ', ' || (2 + X )::varchar || ' ' || (2 + Y 
 )::varchar ||  ', ' || (3 + X )::varchar || ' ' || (1 + Y )::varchar || ', 
 ' || (1 + X)::varchar || ' ' || (1 + Y )::varchar ||  '))')::geometry 
 the_geom from COORDS;


 insert into GEOMS(the_geom) select ('POLYGON((' || (1 + X)::varchar || ' 
 ' || (1 + Y )::varchar || ', ' || (2 + X )::varchar || ' ' || (2 + Y 
 )::varchar ||  ', ' || (3 + X )::varchar || ' ' || (1 + Y )::varchar || ', 
 ' || (1 + X)::varchar || ' ' || (1 + Y )::varchar ||  '))')::geometry 
 the_geom from COORDS;



 The exception:




 insert into GEOMS(the_geom) select ('POLYGON((' || (1 + X)::varchar || 
 ' ' || (1 + Y )::varchar || ', ' || (2 + X )::varchar || ' ' || (2 + Y 
 )::varchar ||  ', ' || (3 + X )::varchar || ' ' || (1 + Y )::varchar || ', 
 ' || (1 + X)::varchar || ' ' || (1 + Y )::varchar ||  '))')::geometry 
 the_geom from COORDS;
 General error: java.lang.IllegalStateException: Corrupt page count 
 -635 [1.3.175/3] 
 [5-175]https://localhost:8082/query.do?jsessionid=2084f6859c202b6be4b35e8d86f708da#HY000/5
  
 (Aide)http://h2database.com/javadoc/org/h2/constant/ErrorCode.html#c5
 org.h2.jdbc.JdbcSQLException: General error: 
 java.lang.IllegalStateException: Corrupt page count -635 [1.3.175/3] 
 [5-175]
 at 
 org.h2.message.DbException.getJdbcSQLException(DbException.java:332http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=332build=175
 )
 at 
 org.h2.message.DbException.get(DbException.java:161http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=161build=175
 )
 at 
 org.h2.message.DbException.convert(DbException.java:284http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=284build=175
 )
 at 
 org.h2.message.DbException.toSQLException(DbException.java:257http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=257build=175
 )
 at 
 org.h2.message.TraceObject.logAndConvert(TraceObject.java:368http://h2database.com/html/source.html?file=org/h2/message/TraceObject.javaline=368build=175
 )
 at 
 org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158http://h2database.com/html/source.html?file=org/h2/jdbc/JdbcStatement.javaline=158build=175
 )
 at 
 org.h2.server.web.WebApp.getResult(WebApp.java:1321http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=1321build=175
 )
 at 
 org.h2.server.web.WebApp.query(WebApp.java:1010http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=1010build=175
 )
 at 
 org.h2.server.web.WebApp$1.next(WebApp.java:972http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=972build=175
 )
 at 
 org.h2.server.web.WebApp$1.next(WebApp.java:959http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=959build=175
 )
 at 
 org.h2.server.web.WebThread.process(WebThread.java:167http://h2database.com/html/source.html?file=org/h2/server/web/WebThread.javaline=167build=175
 )
 at 
 org.h2.server.web.WebThread.run(WebThread.java:94http://h2database.com/html/source.html?file=org/h2/server/web/WebThread.javaline=94build=175
 )
 at java.lang.Thread.run(Thread.java:744)
 Caused by: java.lang.IllegalStateException: Corrupt page count -635 
 [1.3.175/3]
 at 
 org.h2

[h2] MvStore exception Corrupt page count

2014-01-23 Thread Nicolas Fortin (OrbisGIS)
Hi,

Using H2 Version 1.3.175 (2014-01-18) with options 
;MV_STORE=TRUE;MVCC=TRUE. There is a problem with spatial index when I is 
used in combination with mvstore. To following sql requests lead to an 
exception:

create table coords as select (RAND() * 50 ) X, (RAND() * 50 ) Y from 
system_range(1, 2);

create table geoms (id integer primary key auto_increment, the_geom 
geometry);
create spatial index on geoms(the_geom);
insert into GEOMS(the_geom) select ('POLYGON((' || (1 + X)::varchar || ' ' 
|| (1 + Y )::varchar || ', ' || (2 + X )::varchar || ' ' || (2 + Y 
)::varchar ||  ', ' || (3 + X )::varchar || ' ' || (1 + Y )::varchar || ', 
' || (1 + X)::varchar || ' ' || (1 + Y )::varchar ||  '))')::geometry 
the_geom from COORDS;


insert into GEOMS(the_geom) select ('POLYGON((' || (1 + X)::varchar || ' ' 
|| (1 + Y )::varchar || ', ' || (2 + X )::varchar || ' ' || (2 + Y 
)::varchar ||  ', ' || (3 + X )::varchar || ' ' || (1 + Y )::varchar || ', 
' || (1 + X)::varchar || ' ' || (1 + Y )::varchar ||  '))')::geometry 
the_geom from COORDS;



The exception:




 insert into GEOMS(the_geom) select ('POLYGON((' || (1 + X)::varchar || ' ' 
 || (1 + Y )::varchar || ', ' || (2 + X )::varchar || ' ' || (2 + Y 
 )::varchar ||  ', ' || (3 + X )::varchar || ' ' || (1 + Y )::varchar || ', 
 ' || (1 + X)::varchar || ' ' || (1 + Y )::varchar ||  '))')::geometry 
 the_geom from COORDS;
 General error: java.lang.IllegalStateException: Corrupt page count -635 
 [1.3.175/3] 
 [5-175]https://localhost:8082/query.do?jsessionid=2084f6859c202b6be4b35e8d86f708da#HY000/5
  
 (Aide)http://h2database.com/javadoc/org/h2/constant/ErrorCode.html#c5
 org.h2.jdbc.JdbcSQLException: General error: 
 java.lang.IllegalStateException: Corrupt page count -635 [1.3.175/3] 
 [5-175]
 at 
 org.h2.message.DbException.getJdbcSQLException(DbException.java:332http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=332build=175
 )
 at 
 org.h2.message.DbException.get(DbException.java:161http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=161build=175
 )
 at 
 org.h2.message.DbException.convert(DbException.java:284http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=284build=175
 )
 at 
 org.h2.message.DbException.toSQLException(DbException.java:257http://h2database.com/html/source.html?file=org/h2/message/DbException.javaline=257build=175
 )
 at 
 org.h2.message.TraceObject.logAndConvert(TraceObject.java:368http://h2database.com/html/source.html?file=org/h2/message/TraceObject.javaline=368build=175
 )
 at 
 org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158http://h2database.com/html/source.html?file=org/h2/jdbc/JdbcStatement.javaline=158build=175
 )
 at 
 org.h2.server.web.WebApp.getResult(WebApp.java:1321http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=1321build=175
 )
 at 
 org.h2.server.web.WebApp.query(WebApp.java:1010http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=1010build=175
 )
 at 
 org.h2.server.web.WebApp$1.next(WebApp.java:972http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=972build=175
 )
 at 
 org.h2.server.web.WebApp$1.next(WebApp.java:959http://h2database.com/html/source.html?file=org/h2/server/web/WebApp.javaline=959build=175
 )
 at 
 org.h2.server.web.WebThread.process(WebThread.java:167http://h2database.com/html/source.html?file=org/h2/server/web/WebThread.javaline=167build=175
 )
 at 
 org.h2.server.web.WebThread.run(WebThread.java:94http://h2database.com/html/source.html?file=org/h2/server/web/WebThread.javaline=94build=175
 )
 at java.lang.Thread.run(Thread.java:744)
 Caused by: java.lang.IllegalStateException: Corrupt page count -635 
 [1.3.175/3]
 at 
 org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:716http://h2database.com/html/source.html?file=org/h2/mvstore/DataUtils.javaline=716build=175
 )
 at 
 org.h2.mvstore.MVStore.applyFreedSpace(MVStore.java:1060http://h2database.com/html/source.html?file=org/h2/mvstore/MVStore.javaline=1060build=175
 )
 at 
 org.h2.mvstore.MVStore.storeNow(MVStore.java:893http://h2database.com/html/source.html?file=org/h2/mvstore/MVStore.javaline=893build=175
 )
 at 
 org.h2.mvstore.MVStore.commitAndSave(MVStore.java:831http://h2database.com/html/source.html?file=org/h2/mvstore/MVStore.javaline=831build=175
 )
 at 
 org.h2.mvstore.MVStore.beforeWrite(MVStore.java:1669http://h2database.com/html/source.html?file=org/h2/mvstore/MVStore.javaline=1669build=175
 )
 at 
 org.h2.mvstore.MVMap.beforeWrite(MVMap.java:902http://h2database.com/html/source.html?file=org/h2/mvstore/MVMap.javaline=902build=175
 )
 at 
 org.h2.mvstore.MVMap.put(MVMap.java:107http://h2database.com/html/source.html?file=org/h2/mvstore/MVMap.javaline=107build=175
 )
 at 
 

Re: [h2] Re: Two more fix patch for H2 Database

2014-01-10 Thread Nicolas Fortin (OrbisGIS)
Hi,

Ok, thank you. I will work on using H2 Value instead of the inner class.

-Nicolas
IRSTV FR CNRS 2488

Le vendredi 20 décembre 2013 17:37:08 UTC+1, Thomas Mueller a écrit :

 Hi,

 I have now committed the patch to allow using user defined functions that 
 return are result set.

 Aggregate functions with GEOMETRY data type are not yet supported, because 
 I hope we find a better solution.

 Regards,
 Thomas



-- 
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.


[h2] Re: Two more fix patch for H2 Database

2013-12-18 Thread Nicolas Fortin (OrbisGIS)
Hi,

It is ok for geometry optimisation. What about TypeName ?

This patch is really important for table function and aggregation function 
that involve OTHER or JAVA_OBJECT type.


https://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type


https://github.com/nicolas-f/H2-Mirror/compare/h2-with-custom-type.diffhttps://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type
https://github.com/nicolas-f/H2-Mirror/compare/h2-with-custom-type.patchhttps://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type

Thank you

-Nicolas Fortin
IRSTV FR CNRS 2488

-- 
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] Re: Two more fix patch for H2 Database

2013-12-18 Thread Nicolas Fortin (OrbisGIS)
Hi,

As far as I understand, you changed the Aggregate API quite a bit, in order 
 to add the SQL type _name_

I change the API in order to stay backward-compatible on dependency upgrade.

But why not for regular results sets of H2? Why not for other user defined 
 functions, triggers, and so on?

The sql type name is needed only when the objects are not yet available. 
JDBC API says type name should return a fully qualified type 
namehttp://docs.oracle.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnTypeName%28int%29.
 
In h2 user defined aggregate expose function signature only through integer 
sql types; then when we create a table from the result of an aggregate; h2 
first create the table using only aggregate signature, not values (as they 
are not available yet).

But why not for regular results sets of H2

I don't understand what is a regular result set of h2.

-Nicolas Fortin
IRSTV FR CNRS 2488

Le mercredi 18 décembre 2013 17:25:37 UTC+1, Thomas Mueller a écrit :

 Hi,

 Yes, sorry for the delay. I have a few questions. As far as I understand, 
 you changed the Aggregate API quite a bit, in order to add the SQL type 
 _name_ (in addition to the SQL type value such as Types.OTHER). The same 
 for the SimpleResultSet.

 The JDBC API uses the SQL type, but doesn't use the SQL type name in many 
 places (PreparedStatement.setObject and so on doesn't use it; but 
 ResultSetMetaData.getColumnTypeName does). I wonder why is it needed 
 specially for user defined aggregate functions? I can understand it is 
 useful for SimpleResultSet. But why not for regular results sets of H2? Why 
 not for other user defined functions, triggers, and so on?

 Regards,
 Thomas





 On Wed, Dec 18, 2013 at 1:34 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 It is ok for geometry optimisation. What about TypeName ?

 This patch is really important for table function and aggregation 
 function that involve OTHER or JAVA_OBJECT type.


 https://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type


 https://github.com/nicolas-f/H2-Mirror/compare/h2-with-custom-type.diffhttps://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type
 https://github.com/nicolas-f/H2-Mirror/compare/h2-with-custom-type.patchhttps://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type

 Thank you

 -Nicolas Fortin
 IRSTV FR CNRS 2488

 -- 
 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.


[h2] Two more fix patch for H2 Database

2013-12-10 Thread Nicolas Fortin (OrbisGIS)
Hi,

We have two more patch (fix) for H2 Database:

A fix for conversion of Geometry type (and for future type) JDBC/H2. By 
using column type name in addition to column type id.

https://github.com/nicolas-f/H2-Mirror/tree/h2-with-custom-type

A fix for ValueGeometry, in order to parse Well Known  Binary only when the 
Geometry object is requested.

https://github.com/nicolas-f/H2-Mirror/tree/optimize-geometry

Thanks to GIT cherry picking a merge this two patch from the last release 
of h2 (r5331):

https://github.com/nicolas-f/H2-Mirror/tree/h2-fork-r5331

Thank you

-- 
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.


[h2] Introduce FAST in CREATE ALIAS STATEMENT

2013-12-02 Thread Nicolas Fortin (OrbisGIS)
Hi,

We wrote some table function in H2GIS. However H2 always do multiple cache 
files of our generated resultset. The function 
org.h2.expression.JavaFunction#isFast return always False. What about 
creating an optional parameter FAST ?

create alias MYTABLEFUNCTION FAST FOR org.mycompany.myclass.tablefunction;

If Fast is not specified then org.h2.expression.JavaFunction#isFast return 
False.

What do you think about it ?

Thank you

Regards,

PS: I have also a patch proposition in issues.

-- 
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.


[h2] AggregateFunction and DatabaseEventListener#setProgress

2013-10-02 Thread Nicolas Fortin (OrbisGIS)
Hi,

AggregateFunction and table function can be time consuming, as h2 provide a 
way to get the current task progression.

 I'm wondering if there is a way to acquire the Connection's 
DatabaseEventListener ?

Regards,

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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] Support for the POINT datatype such as Postgres and Mysql have

2013-09-27 Thread Nicolas Fortin (OrbisGIS)
Hi,

Yes you are right , point is only a constraint. In H2GIS here 
https://github.com/irstv/H2GIS there is a complete set of Constraint (Point 
Polygon and LineString) and standard spatial functions.

You can use the quick start here, https://github.com/irstv/H2GIS/wiki there 
is a build (h2gis dist) that embed h2 h2gis and jts.

H2GIS use a slightly modified h2 version because Geometry.equals is 
improperly used in ValueGeometry. ValueGeometry should use WKB (binary) 
equality check.


-- 
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] Support for the POINT datatype such as Postgres and Mysql have

2013-09-27 Thread Nicolas Fortin (OrbisGIS)
You can use regular h2 by using geometry type and WKT

create table pttable (the_geom geometry);
insert into pttable values( 'POINT ( 10 10 10 )');


In JDBC you get the values using this function:

*import com.vividsolutions.jts.geom.Point;

 *

 ResultSet rs = statement.executeQuery( select * from pttable );
 while( rs.next() ) {
 Point myPoint = (Point)rs.getObject(1);
 }


Documentation of jts is here:
http://tsusiatsoftware.net/jts/main.html
Point class:
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Point.html
 
-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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 more detailed Syntax Exception

2013-09-10 Thread Nicolas Fortin (OrbisGIS)
Hi,

Thanks to git, I do cherry picking in order to patch the current svn trunk:

https://github.com/nicolas-f/h2database/tree/patch-svn-bnf

It should be easier to merge with your old svn :P

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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 more detailed Syntax Exception

2013-09-09 Thread Nicolas Fortin (OrbisGIS)
Hi,

I've done auto completion of procedures into the h2 core.

https://github.com/nicolas-f/h2database/tree/feature/autocomplete

And a unit test:

https://github.com/nicolas-f/h2database/blob/feature/autocomplete/h2/src/test/org/h2/test/unit/TestBnf.java

For procedure's parameters, I set a filter to show only columns that fit 
(by field type)

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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 more detailed Syntax Exception

2013-09-04 Thread Nicolas Fortin (OrbisGIS)
Hi,

It is difficult to move as WebApp.java use protected fields of Db*.java 
class. I don't know if you want set this public or use getters().

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le mardi 3 septembre 2013 19:51:12 UTC+2, Thomas Mueller a écrit :

 Hi,

 Could you also move the DbContextRule and related classes to the new 
 package, for example org.h2.bnf.context? I can do it of course, but then 
 merging changes would be a bit harder I guess.
  
 Regards,
 Thomas


 On Tue, Sep 3, 2013 at 4:54 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 I will update the DbContextRule in order to parse 
 Connection.getMetaData().getProcedures()


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488


 Le lundi 2 septembre 2013 13:31:46 UTC+2, Nicolas Fortin (OrbisGIS) a 
 écrit :

 Hi,

 I did some modifications on h2 (OSGi export and function visibility 
 change), and update the RSyntaxAutoComplete. It works well:



 https://lh5.googleusercontent.com/-Rv1Or8Se7xU/UiR1dqs2PlI/AAM/ANVYTVP7ZXU/s1600/auto_complete.png

 H2 branch:
 https://github.com/nicolas-f/**h2database/tree/fix/isGeometryhttps://github.com/nicolas-f/h2database/tree/fix/isGeometry

 Regards,

 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

  -- 
 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] H2 more detailed Syntax Exception

2013-09-03 Thread Nicolas Fortin (OrbisGIS)
Hi,

I will update the DbContextRule in order to parse 
Connection.getMetaData().getProcedures()

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488


Le lundi 2 septembre 2013 13:31:46 UTC+2, Nicolas Fortin (OrbisGIS) a 
écrit :

 Hi,

 I did some modifications on h2 (OSGi export and function visibility 
 change), and update the RSyntaxAutoComplete. It works well:



 https://lh5.googleusercontent.com/-Rv1Or8Se7xU/UiR1dqs2PlI/AAM/ANVYTVP7ZXU/s1600/auto_complete.png

 H2 branch:
 https://github.com/nicolas-f/h2database/tree/fix/isGeometry

 Regards,

 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488


-- 
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 more detailed Syntax Exception

2013-09-02 Thread Nicolas Fortin (OrbisGIS)
Hi,

I did some modifications on h2 (OSGi export and function visibility 
change), and update the RSyntaxAutoComplete. It works well:


https://lh5.googleusercontent.com/-Rv1Or8Se7xU/UiR1dqs2PlI/AAM/ANVYTVP7ZXU/s1600/auto_complete.png

H2 branch:
https://github.com/nicolas-f/h2database/tree/fix/isGeometry

Regards,

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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 more detailed Syntax Exception

2013-09-01 Thread Nicolas Fortin (OrbisGIS)
Hi,

Ok for syntax error position. I encounter some function visibility problems 
in 
http://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/server/web/DbContents.java
 
as it use default visibility (protected) and it is not exported in OSGi. 
May be I should write my own ?

Thank you

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le dimanche 1 septembre 2013 09:16:27 UTC+2, Thomas Mueller a écrit :

 Hi,

 So, I guess I will remove the JdbcParseSQLException interface. It's a bit 
 problematic as it doesn't work for the client/server case (of course it 
 could be made to work, but I would like to avoid this added complexity).

 I will try to add the syntaxErrorPosition field in the JdbcSQLException 
 however. The expectedTokens I will not add right now.

 Regards,
 Thomas



 On Fri, Aug 30, 2013 at 9:45 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

  Hi,

 Ouch, yes I missed this package, thank you ! I have to update the csv 
 file to synchronize with the last update of the h2 parser. It seems that I 
 can feed the bnf with DatabaseMetaData, great.

 I'm on it.


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488


 Le jeudi 29 août 2013 17:16:23 UTC+2, Thomas Mueller a écrit :

 Hi,

 Do you want to do something like the H2 Console autocomplete feature? If 
 yes, then it would be better to use the BNF tool, like the H2 Console does. 
 That way, you can add table names / column names and so on.

 Regards,
 Thomas



 On Thu, Aug 29, 2013 at 4:44 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 Yes I need this, as it will feed the console auto-completion.


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le jeudi 29 août 2013 16:31:28 UTC+2, Thomas Mueller a écrit :

  Hi,

  this is why the Noel's PARSE sql request seems to be a better 
 solution.

 I'm not yet convinced this is the best solution.

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for 
 expected:.


  I can't as this message can be translated or changed later.

 My question was: do you need it?

 You don't need to implement it yourself. This can be implemented in H2 
 itself (I can implement it). Translation is not a problem.

 Regards,
 Thomas




 On Thu, Aug 29, 2013 at 4:01 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 The current solution doesn't work for the client/server case.


 It's true, this is why the Noel's PARSE sql request seems to be a 
 better solution.


 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for 
 expected:.


 I can't as this message can be translated or changed later.


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le jeudi 29 août 2013 14:34:02 UTC+2, Thomas Mueller a écrit :

 Hi,

 The current solution doesn't work for the client/server case.

 What about removing the JdbcParseSQLException interface, and 
 extending JdbcSQLException with getSyntaxErrorPosition? It would return 
 -1 
 if it's not a syntax exception, and would return the position if it is.

 Internally, JdbcSQLException could detect the position by searching 
 for the first [*] in the sql field. I know this wouldn't be a 100% 
 correct solution, because somebody might type [*] in the query for 
 some 
 reason. But it might be good enough for now. The position could be 
 stored 
 as a separate field as well, but then the client/server protocol would 
 need 
 to be changed (which would be slightly more work).

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for 
 expected:.

 Regards,
 Thomas


 On Wed, Aug 28, 2013 at 8:39 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 Yes it seems that it is a better solution, it will work on server 
 mode also.

 Regards,


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le samedi 24 août 2013 21:49:01 UTC+2, Noel Grandin a écrit :

 Maybe we're thinking about this the wrong way. The way the JDBC 
 API 
 and SQL works is not to try and pass around and catch specialised 
 exceptions. 

 Maybe we should be exposing a new SQL command. 

 So the client can do 
PARSE command 
 and we return either an empty result set in the case of a 
 successful 
 parse, or a result set containing 
   PARSE_INDEX, EXPECTED_TOKENS, MESSAGE 

  -- 
 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.**co**m.
 To post to this group, send email to h2-da...@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/**grou
 ps/opt_out https://groups.google.com/groups/opt_out.


  -- 
 You received this message

Re: [h2] H2 more detailed Syntax Exception

2013-08-30 Thread Nicolas Fortin (OrbisGIS)
 Hi,

Ouch, yes I missed this package, thank you ! I have to update the csv file 
to synchronize with the last update of the h2 parser. It seems that I can 
feed the bnf with DatabaseMetaData, great.

I'm on it.

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488


Le jeudi 29 août 2013 17:16:23 UTC+2, Thomas Mueller a écrit :

 Hi,

 Do you want to do something like the H2 Console autocomplete feature? If 
 yes, then it would be better to use the BNF tool, like the H2 Console does. 
 That way, you can add table names / column names and so on.

 Regards,
 Thomas



 On Thu, Aug 29, 2013 at 4:44 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 Yes I need this, as it will feed the console auto-completion.


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le jeudi 29 août 2013 16:31:28 UTC+2, Thomas Mueller a écrit :

 Hi,

  this is why the Noel's PARSE sql request seems to be a better 
 solution.

 I'm not yet convinced this is the best solution.

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.


  I can't as this message can be translated or changed later.

 My question was: do you need it?

 You don't need to implement it yourself. This can be implemented in H2 
 itself (I can implement it). Translation is not a problem.

 Regards,
 Thomas




 On Thu, Aug 29, 2013 at 4:01 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 The current solution doesn't work for the client/server case.


 It's true, this is why the Noel's PARSE sql request seems to be a 
 better solution.


 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.


 I can't as this message can be translated or changed later.


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le jeudi 29 août 2013 14:34:02 UTC+2, Thomas Mueller a écrit :

 Hi,

 The current solution doesn't work for the client/server case.

 What about removing the JdbcParseSQLException interface, and extending 
 JdbcSQLException with getSyntaxErrorPosition? It would return -1 if it's 
 not a syntax exception, and would return the position if it is.

 Internally, JdbcSQLException could detect the position by searching 
 for the first [*] in the sql field. I know this wouldn't be a 100% 
 correct solution, because somebody might type [*] in the query for some 
 reason. But it might be good enough for now. The position could be stored 
 as a separate field as well, but then the client/server protocol would 
 need 
 to be changed (which would be slightly more work).

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.

 Regards,
 Thomas


 On Wed, Aug 28, 2013 at 8:39 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 Yes it seems that it is a better solution, it will work on server 
 mode also.

 Regards,


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le samedi 24 août 2013 21:49:01 UTC+2, Noel Grandin a écrit :

 Maybe we're thinking about this the wrong way. The way the JDBC API 
 and SQL works is not to try and pass around and catch specialised 
 exceptions. 

 Maybe we should be exposing a new SQL command. 

 So the client can do 
PARSE command 
 and we return either an empty result set in the case of a successful 
 parse, or a result set containing 
   PARSE_INDEX, EXPECTED_TOKENS, MESSAGE 

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

Re: [h2] H2 more detailed Syntax Exception

2013-08-29 Thread Nicolas Fortin (OrbisGIS)
Hi,

The current solution doesn't work for the client/server case.


It's true, this is why the Noel's PARSE sql request seems to be a better 
solution.

Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.


I can't as this message can be translated or changed later.

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le jeudi 29 août 2013 14:34:02 UTC+2, Thomas Mueller a écrit :

 Hi,

 The current solution doesn't work for the client/server case.

 What about removing the JdbcParseSQLException interface, and extending 
 JdbcSQLException with getSyntaxErrorPosition? It would return -1 if it's 
 not a syntax exception, and would return the position if it is.

 Internally, JdbcSQLException could detect the position by searching for 
 the first [*] in the sql field. I know this wouldn't be a 100% correct 
 solution, because somebody might type [*] in the query for some reason. 
 But it might be good enough for now. The position could be stored as a 
 separate field as well, but then the client/server protocol would need to 
 be changed (which would be slightly more work).

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.

 Regards,
 Thomas


 On Wed, Aug 28, 2013 at 8:39 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 Yes it seems that it is a better solution, it will work on server mode 
 also.

 Regards,


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le samedi 24 août 2013 21:49:01 UTC+2, Noel Grandin a écrit :

 Maybe we're thinking about this the wrong way. The way the JDBC API 
 and SQL works is not to try and pass around and catch specialised 
 exceptions. 

 Maybe we should be exposing a new SQL command. 

 So the client can do 
PARSE command 
 and we return either an empty result set in the case of a successful 
 parse, or a result set containing 
   PARSE_INDEX, EXPECTED_TOKENS, MESSAGE 

  -- 
 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] H2 more detailed Syntax Exception

2013-08-29 Thread Nicolas Fortin (OrbisGIS)
Hi,

Yes I need this, as it will feed the console auto-completion.

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le jeudi 29 août 2013 16:31:28 UTC+2, Thomas Mueller a écrit :

 Hi,

  this is why the Noel's PARSE sql request seems to be a better solution.

 I'm not yet convinced this is the best solution.

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.


  I can't as this message can be translated or changed later.

 My question was: do you need it?

 You don't need to implement it yourself. This can be implemented in H2 
 itself (I can implement it). Translation is not a problem.

 Regards,
 Thomas




 On Thu, Aug 29, 2013 at 4:01 PM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com javascript: wrote:

 Hi,

 The current solution doesn't work for the client/server case.


 It's true, this is why the Noel's PARSE sql request seems to be a better 
 solution.


 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.


 I can't as this message can be translated or changed later.


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le jeudi 29 août 2013 14:34:02 UTC+2, Thomas Mueller a écrit :

 Hi,

 The current solution doesn't work for the client/server case.

 What about removing the JdbcParseSQLException interface, and extending 
 JdbcSQLException with getSyntaxErrorPosition? It would return -1 if it's 
 not a syntax exception, and would return the position if it is.

 Internally, JdbcSQLException could detect the position by searching for 
 the first [*] in the sql field. I know this wouldn't be a 100% correct 
 solution, because somebody might type [*] in the query for some reason. 
 But it might be good enough for now. The position could be stored as a 
 separate field as well, but then the client/server protocol would need to 
 be changed (which would be slightly more work).

 Do you really need the method getExpectedTokens? If yes, then 
 JdbcSQLException could parse the error message and search for expected:.

 Regards,
 Thomas


 On Wed, Aug 28, 2013 at 8:39 AM, Nicolas Fortin (OrbisGIS) 
 nico@gmail.com wrote:

 Hi,

 Yes it seems that it is a better solution, it will work on server mode 
 also.

 Regards,


 -Nicolas Fortin
 Atelier SIG
 IRSTV FR CNRS 2488

 Le samedi 24 août 2013 21:49:01 UTC+2, Noel Grandin a écrit :

 Maybe we're thinking about this the wrong way. The way the JDBC API 
 and SQL works is not to try and pass around and catch specialised 
 exceptions. 

 Maybe we should be exposing a new SQL command. 

 So the client can do 
PARSE command 
 and we return either an empty result set in the case of a successful 
 parse, or a result set containing 
   PARSE_INDEX, EXPECTED_TOKENS, MESSAGE 

  -- 
 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-databasehttp://groups.google.com/group/h2-database
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://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...@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] H2 more detailed Syntax Exception

2013-08-28 Thread Nicolas Fortin (OrbisGIS)
Hi,

Yes it seems that it is a better solution, it will work on server mode also.

Regards,

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le samedi 24 août 2013 21:49:01 UTC+2, Noel Grandin a écrit :

 Maybe we're thinking about this the wrong way. The way the JDBC API 
 and SQL works is not to try and pass around and catch specialised 
 exceptions. 

 Maybe we should be exposing a new SQL command. 

 So the client can do 
PARSE command 
 and we return either an empty result set in the case of a successful 
 parse, or a result set containing 
   PARSE_INDEX, EXPECTED_TOKENS, MESSAGE 


-- 
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 trunk, fix Geometry

2013-08-26 Thread Nicolas Fortin (OrbisGIS)

JTS import is here:
https://github.com/nicolas-f/h2database/commit/0042bf99cc677515cee6b91d4b8723e3330507bd

About GeometryValue.equals they answered that this is the expected result 
http://sourceforge.net/p/jts-topo-suite/bugs/40/ .

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le lundi 26 août 2013 11:30:15 UTC+2, Noel Grandin a écrit :

  
 On 2013-08-26 10:54, Nicolas Fortin (OrbisGIS) wrote:
  
 Some things are still missing:


- Equals method of Geometry is not the one expected by ValueGeometry, 
we should do a wkb binary comparison as it is the only way to avoid false 
duplicate. (The cache return another geometry with other srid or z) 

  I maintain that this is a bug in JTS that needs to be fixed in JTS.


  
- JTS is not imported in the H2 manifest 

  Sorry, I seem to have missed that - do you have a patch somewhere?

 

-- 
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 trunk, fix Geometry

2013-08-26 Thread Nicolas Fortin (OrbisGIS)


 I've already said that patch is not acceptable. 


Just take the lines 33,34 

-- 
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 more detailed Syntax Exception

2013-08-24 Thread Nicolas Fortin (OrbisGIS)
Hi Thomas,

Yes you can use JdbcSQLException class that implements the following java 
interface:
https://github.com/nicolas-f/h2database/blob/feature/exception-info/h2/src/main/org/h2/api/SQLParseException.java

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488


Le samedi 24 août 2013 11:19:28 UTC+2, Thomas Mueller a écrit :

 Hi,

 I'm not convinced that using another exception class is a good idea. This 
 new exception class has to be supported in multiple places (remoting the 
 exception for example).

 What about extending the existing class (JdbcSQLException) with the 
 required data? If it's not a parse exception, then the field is empty.

 Regards,
 Thomas


-- 
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 more detailed Syntax Exception

2013-08-23 Thread Nicolas Fortin (OrbisGIS)
Hi,

Here the h2 branch where exception info is added:

https://github.com/nicolas-f/h2database/tree/feature/exception-info

If this is a Parse exception then an implementation of the 
SQLParseException interface is thrown to the caller.

It works only on embedded mode.

This version of H2 is used by RSyntaxArea SQL parser and auto complete 
library (work in progress):
https://github.com/nicolas-f/orbisgis/tree/orbisgis-h2/bundles/sqlconsole-parser

Regards,

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le vendredi 2 août 2013 17:08:44 UTC+2, Noel Grandin a écrit :


 On 2013-08-02 16:59, Nicolas Fortin (OrbisGIS) wrote: 
  Hi, 
  
  I'm currently writing a add-on on RSyntaxText Area in order to 
  underline in red syntax error in sql window, and also to autocomplete 
  sql. In order to do that I was thinking about using H2 explain 
  statements, catch exception and parse it. Parse String message is 
  really crap, then I think about patch h2 in order to store additional 
  information about the syntax error, like the exception class done by 
  Akiban Parser: 
  
 http://akiban.github.io/sql-parser/javadoc/com/akiban/sql/parser/ParseException.html
  
  
  I work on this patch in a separate branch from trunk of H2. More 
  information the August 19. 

 That sounds like a good idea. 

 If you declare a sub-class of DbException, you can add the extra info 
 you need. 

 something like: 
 public class DbParseException extends DbException { 
 private final int parseIndex; 
 private final ArrayListString expectedList; 
  
 } 

 And then the place to modify is the Parser#getSyntaxError and 
 DbException.getSyntaxError methods to generate and throw this subclass. 

 Regards, 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+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 trunk, fix Geometry

2013-08-23 Thread Nicolas Fortin (OrbisGIS)
I will use a (dirty) workaround. I will create a Fragment-Bundle (a bundle 
that share the same class loader as H2) then do not import in manifest 
(org.h2.command.ddl,org.h2.engine,org.h2.message,org.h2.index,org.h2.table,org.h2.result)






-- 
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 more detailed Syntax Exception

2013-08-23 Thread Nicolas Fortin (OrbisGIS)
Your unit test is better.

However org.h2.api should contain java interface. This will give you more 
freedom in future implementations without break anything.

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le vendredi 23 août 2013 15:48:33 UTC+2, Noel Grandin a écrit :


 On 2013-08-23 15:02, Nicolas Fortin (OrbisGIS) wrote: 
  Here the h2 branch where exception info is added: 
  
  https://github.com/nicolas-f/h2database/tree/feature/exception-info 

 Thank you very much, your patch has been committed (with some changes). 


-- 
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 trunk, fix Geometry

2013-08-20 Thread Nicolas Fortin (OrbisGIS)
Hello Martin Davis,

As you advised I use the CoordinateSequenceFilter instead of iterating over 
vertices:
https://github.com/nicolas-f/h2database/commit/d168e04e061d470aebbc8749ce9663e97a7da18f

About the OSGi manifest. If you don't want to expose more package in OSGi, 
how to use org.h2.api.TableEngine as it imports org.h2.table.TableBase ?

Thanks for support

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

Le mardi 20 août 2013 03:16:10 UTC+2, Martin Davis a écrit :

 Sigh, yes, the JTS handling of Z values is a bit weak right now.  Hoping 
 to improve this in redesign of the API - but it will break lots of things 
 unfortunately.

 In absence of better metadata about the coordinate dimension the method of 
 checking for Z = NaN is about all that can be done right now, .  Be aware 
 however that Geometry.getCoordinates() is a bit inefficient for complex 
 geometries, since it has to create one big array to hold all Coordinate 
 values, and then traverse the geometry copying the references.  Using a 
 CoordinateFilter would be more efficient.


-- 
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.


[h2] H2 trunk, fix Geometry

2013-08-19 Thread Nicolas Fortin (OrbisGIS)
Hi,

I made some fix on spatial h2 starting from the current trunk, it is here:

https://github.com/nicolas-f/h2database/tree/fix/isGeometry

The first fix, isGeometry function, a mix was done on Geometry object/class:

https://github.com/nicolas-f/h2database/commit/ac5fab9fffbf5cfd63f7e67e8ce4fa90da727dbc

Second fix, WKB export, SRID and Z was missing:

https://github.com/nicolas-f/h2database/commit/f8df369622defb0413aa15b8e78ee35b0d461ca8

Third fix, ValueGeometry.equals, GeometryCollection throws an error when 
equals is used, using a work around through binary comparison:

https://github.com/nicolas-f/h2database/commit/57d141acb4a97b960f704860994a283b33e69d40

Fourth fix, update OSGi bundle manifest in order to optionally import JTS 
and export some other package of h2 to be able to write a table engine in a 
remote OSGi bundle.

https://github.com/nicolas-f/h2database/commit/0042bf99cc677515cee6b91d4b8723e3330507bd

Thanks

-Nicolas Fortin
Atelier SIG
IRSTV FR CNRS 2488

-- 
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 trunk, fix Geometry

2013-08-19 Thread Nicolas Fortin (OrbisGIS)


  The first fix, isGeometry function, a mix was done on Geometry 
  object/class: 
  
  
 https://github.com/nicolas-f/h2database/commit/ac5fab9fffbf5cfd63f7e67e8ce4fa90da727dbc
  
  
 This commit makes no sense at all. 
 - you have created a unnecessary recursive call in DataType#isGeometry 
 - you have broken the case where the geometry stuff is not on the 
 classpath 
 - you have removed a test case from TestSpatial for no reason that I can 
 see. 


This is not recursive, it uses the other function that test class, not 
object.
the second function test if static geometry constant is null.
The random test case is covered by Thomas MVMap unit test in a cleaner way 
(without random, and way more faster)
 

  Second fix, WKB export, SRID and Z was missing: 
  
  
 https://github.com/nicolas-f/h2database/commit/f8df369622defb0413aa15b8e78ee35b0d461ca8
  

 This fix assumes that Geometry will always be 3D, which means that we 
 will no longer support 2D geometry, which does not seem like a good idea 
 to me. 


You are right, we can replace the constructor by this:
new WKBWriter(geometry.getDimension(), geometry.getSRID() != 0)
 

  
  Third fix, ValueGeometry.equals, GeometryCollection throws an error 
  when equals is used, using a work around through binary comparison: 
  
  
 https://github.com/nicolas-f/h2database/commit/57d141acb4a97b960f704860994a283b33e69d40
  

 This commit also makes no sense. Why is the Geometry class throwing an 
 IllegalArgumentException? We need more explanation here. 


Geometry compute the intersection matrix (more robust to rounding errors), 
this cannot be done with GeometryCollection, then it throws an exception. 
Test all geometries inside the collection separatly may be another solution.
 


  
  Fourth fix, update OSGi bundle manifest in order to optionally import 
  JTS and export some other package of h2 to be able to write a table 
  engine in a remote OSGi bundle. 
  
  
 https://github.com/nicolas-f/h2database/commit/0042bf99cc677515cee6b91d4b8723e3330507bd
  

 I'm going to leave this for Thomas to comment on. 
 Historically we have been very loathe to expose more of H2's internals 
 because we have no intention of making all of this stuff part of our 
 supported API. 


There is the TableEngine in the api package, however it has dependency on 
other (hidden) packages. 

-- 
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.


  1   2   >