Re: [h2] Re: Can't get H2 1.4.193 in embedded mode to connect to existing ~/test.mv.db

2016-11-08 Thread Noel Grandin
that looks like you are using an old version of H2 in your application,
which is opening a database based on the PageStore engine, hence the .h2.db
file extension.

the web console is running a newer version, and is defaulting to the
MVStore engine, hence the .mv.db file extension
​

-- 
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: What will happen if......

2016-11-08 Thread Rinse Lemstra
Any other suggestions how curruptions like below could arise ?



Caused by: org.h2.jdbc.JdbcSQLException: File corrupted while reading 
record: "22081 of 21060". Possible solution: use the recovery tool 
[90030-190]
at org.h2.store.PageStore.readPage(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.store.PageStore.getPage(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.index.PageDataIndex.getPage(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.index.PageDataIndex.(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.table.RegularTable.(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.store.PageStore.addMeta(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.store.PageStore.readMetaData(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.store.PageStore.recover(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.store.PageStore.openExisting(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.store.PageStore.open(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Database.getPageStore(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Database.open(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Database.openDatabase(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Database.(Unknown Source) ~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Engine.openSession(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Engine.openSession(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Engine.createSessionAndValidate(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Engine.createSession(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.Engine.createSession(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.jdbc.JdbcConnection.(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.jdbc.JdbcConnection.(Unknown Source) 
~[h2-1.4.190.jar:1.4.190]
at org.h2.Driver.connect(Unknown Source) ~[h2-1.4.190.jar:1.4.190]




Op dinsdag 8 november 2016 14:21:49 UTC+1 schreef Rinse Lemstra:
>
> We open our database with:
>
>  
>
> Connection connection = new 
> org.h2.Driver().connect(“jdbc:h2:file:\\Data;FILE_LOCK=FILE;AUTO_SERVER=TRUE;MODE=REGULAR;MV_STORE=FALSE;DB_CLOSE_DELAY=0",
>  
> new Properties() );
>
>  
>
> We close our database with:
>
>  
>
> connection.close();
>
>  
>
>  
>
> What will happen if the user in (auto_server) server role performs a 
> connection.close  while a user in (auto_server) client role is still 
> performing updates?
>
>  
>
> Could this lead to database corruptions?
>
>
>
> regards,
>
>
> Rinse
>
>  
>

-- 
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] Recovery DB Help

2016-11-08 Thread Noel Grandin

I'm afraid your database is corrupt, there is not really anything you can 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.


Re: [h2] How to determine whether a file is H2 database?

2016-11-08 Thread Noel Grandin

Nope.

--
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 will happen if......

2016-11-08 Thread Noel Grandin

No.

But if the primary application exits, the secondary application will lose it's 
connection to the database.

--
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] What will happen if......

2016-11-08 Thread Rinse Lemstra


We open our database with:

 

Connection connection = new 
org.h2.Driver().connect(“jdbc:h2:file:\\Data;FILE_LOCK=FILE;AUTO_SERVER=TRUE;MODE=REGULAR;MV_STORE=FALSE;DB_CLOSE_DELAY=0",
 
new Properties() );

 

We close our database with:

 

connection.close();

 

 

What will happen if the user in (auto_server) server role performs a 
connection.close  while a user in (auto_server) client role is still 
performing updates?

 

Could this lead to database corruptions?



regards,


Rinse

 

-- 
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-11-08 Thread Sven
Update (just that this ) won't happen:

The issue could be resolved, the pull request 
https://github.com/h2database/h2database/pull/391/ 

 has 
been merged into master.

Adding/removing null spatial keys into MVSpatialIndex 

 is 
pointless, as they cannot be found based on a bounding box. Therefore, they 
are ignored. Thanks for watching.

-- 
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] Huge memory requirements for simple select order by - why?

2016-11-08 Thread Johann Petrak
I have implemented this for my special case and I keep having problems:
I use a prepared select statement with 
an LIMIT ? OFFSET ? clause I retrieve just 10 of the 100 million rows
every time.  
I initially still got out of memory exceptions and ended up giving 80G heap 
space
to the process.

This works well initially: when I observe the process in jconsole, each 
select 
statement only takes a few minutes to get processed and uses less than 20G.
However the more iterations of carrying out the prepared select with new 
offset limit values are done, the more memory is consumed and even worse,
much worse, the more time it takes. The most recent batch of processing 
10 rows
took all night!
(BTW "processing" means just reading the rows from the result set using 
next(),
and writing them to a file so the slow-down cannot come from my own code). 

Is anything known about this kind of behaviour or could I still be doing 
something
that could get improved and solve my problems? 

My feeling is that even though offset and limit is used, the database 
spends a large
amount of time to actually get to the starting offset of the result set, so 
the time required to do this grows with increasing offset. 

So using this limit/offset approach to get around the problem of huge 
result sets
because there is no server side cursor support does not seem to be a usable 
solution 
to my problem either -- I guess I have to look for a different database. 
Any suggestions
for a good replacement just for this specific task which an be used in 
embedded mode
(without complex installation, setting up, etc.)? 


On Saturday, 5 November 2016 18:06:35 UTC, Johann Petrak wrote:
>
> Thanks for pointing this out -- I missed the corresponding remark in 
>   http://www.h2database.com/html/advanced.html
> I had only been looking at the documentation of setFetchSize here:
>   http://www.h2database.com/javadoc/org/h2/jdbc/JdbcStatement.html
>
> For me this is rather bad news because while this is one concrete example, 
> the software is written to handle arbitrary select statements (which could
> eg already contain limit/offset clauses, but with rather large limit 
> numbers). 
>
> To work around this with limit/offset also has the problem that there may 
> still 
> be a big overhead of creating too many such queries, depending on the 
> complexity
> of the query while creating too few may run in the out of memory 
> problem again. 
>
> On Saturday, 5 November 2016 17:48:44 UTC, Noel Grandin wrote:
>>
>> we don't do server-side cursors yet. which is what you're asking for.
>>
>> use SELECT..LIMIT..OFFSET
>>
>> to limit the amount of data you pull in one SELECT
>> ​
>>
>

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