Re: [h2] H2 Database Engine: New version released

2023-08-29 Thread Jürgen Pingel
Thanks for the fix version 2.2.222.
Don't know if it will work for me, because I run with that revision into a 
performance problem.
One of my unit tests runs now extremely long and it seems that much memory 
get allocated.
Can't send you the complete code but I isolate it to the SQL statements and 
looks like: 

CREATE TABLE IF NOT EXISTS A (number VARCHAR(128) not NULL, intent INT not 
NULL, objID VARCHAR(30) not NULL, objType SMALLINT  not NULL, PRIMARY KEY 
(number,intent,objID,objType)); 
CREATE INDEX IF NOT EXISTS A_IDX ON A(objType,objID,intent);
CREATE INDEX IF NOT EXISTS A_type_IDX ON A (objType);

for (int loop = 0, number = 0; loop < 300; ++loop){
  DROP TABLE IF EXISTS B; 
  CREATE TABLE IF NOT EXISTS B (number VARCHAR(128) not NULL, intent INT 
not NULL, objID VARCHAR(30) not NULL, objType SMALLINT  not NULL, PRIMARY 
KEY (number,intent,objID,objType)); 
  CREATE INDEX IF NOT EXISTS B_IDX ON B(objType,objID,intent);

  for (int i = 0; i < 100; ++i) { 
++number;
MERGE INTO B (number,intent,objID,objType) VALUES 
(Integer.toString(number),1, Integer.toString(number), 1) 
  }
  
  DELETE FROM A T WHERE EXISTS (SELECT NULL from A S WHERE T.objID=S.objID 
AND T.objType=S.objType AND T.intent=S.intent AND T.number<>S.number)
  MERGE INTO A T USING (SELECT * FROM B) AS S ON T.objID=S.objID AND 
T.objType=S.objType AND T.intent=S.intent AND T.number=S.number WHEN NOT 
MATCHED THEN INSERT (objID, objType, number, intent) VALUES (S.objID, 
S.objType, S.number, S.intent);
  DROP TABLE B CASCADE
}

If run with the previous versions 1.4, 2.1 and 2.2.220 it's finished after 
some seconds.
With the 2.2.222 it takes longer with each loop; don't finish after some 
minutes.

Please take a look; thanks.

Thanks,
  Jürgen
Andreas Reichel schrieb am Mittwoch, 23. August 2023 um 14:12:42 UTC+2:

> On Wed, 2023-08-23 at 08:09 -0400, Andrei Tokar wrote:
>
> This is a patch release, and AFAIK there are no incompatibilities with
> on-disk format of v.2.2.220, so hopefully it can be used as drop in
> replacement for 2.2.220 (and only 2.2.220!).
>
>
>
> Thank you very much.
> Just in case: We have amended H2MigrationTool for support of H2 2.2.222 
> already.
>
> http://h2migrationtool.manticore-projects.com/
>
> Best regards
> Andreas
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/a9dde386-ec94-4beb-b13a-a2913f6e4311n%40googlegroups.com.


Re: [h2] H2 Database Engine: New version released

2023-08-15 Thread Jürgen Pingel
Hello, 
I have also this problem using the same H2 version - get a corrupted 
database.
Do you have any solution or fix? 
Because without any fix that version is unusable for me.

Thanks,
  Jürgen
TheRaywell schrieb am Donnerstag, 20. Juli 2023 um 03:36:29 UTC+2:

> H2 last release (220): after insert /delete command :
>
> In runtime, after a few inserts and deletions to the database version 
> 2.2.220, our database was damaged, and we observe such a picture on several 
> servers.
> Before that, we used version 2.1.214 for over 4 months without problem.
> The database version 220 was created from 0 and data was entered into it 
> by sql commands.
> 2023-07-17 12:19:52 database: flush
> org.h2.message.DbException: General error: 
> "org.h2.mvstore.MVStoreException: File corrupted in chunk 134, expected 
> page length 4..768, got 200383807 [2.2.220/6]" [5-220]
> at org.h2.message.DbException.get(DbException.java:212)
> at org.h2.message.DbException.convert(DbException.java:407)
> at org.h2.mvstore.db.Store.lambda$new$0(Store.java:122)
> at 
> org.h2.mvstore.MVStore.handleException(MVStore.java:1547)
> at org.h2.mvstore.MVStore.panic(MVStore.java:371)
> at 
> org.h2.mvstore.MVStore.tryExecuteUnderStoreLock(MVStore.java:940)
> at 
> org.h2.mvstore.RandomAccessStore.doHousekeeping(RandomAccessStore.java:721)
> at 
> org.h2.mvstore.FileStore.writeInBackground(FileStore.java:1838)
> at 
> org.h2.mvstore.FileStore$BackgroundWriterThread.run(FileStore.java:2249)
> Caused by: org.h2.jdbc.JdbcSQLNonTransientException: General error: 
> "org.h2.mvstore.MVStoreException: File corrupted in chunk 134, expected 
> page length 4..768, got 200383807 [2.2.220/6]" [5-220]
> at 
> org.h2.message.DbException.getJdbcSQLException(DbException.java:566)
> at 
> org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
> ... 9 more
> Caused by: org.h2.mvstore.MVStoreException: File corrupted in chunk 134, 
> expected page length 4..768, got 200383807 [2.2.220/6]
> at 
> org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996)
> at org.h2.mvstore.Page.read(Page.java:590)
> at org.h2.mvstore.Page.read(Page.java:262)
> at org.h2.mvstore.FileStore.readPage(FileStore.java:1969)
> at org.h2.mvstore.MVStore.readPage(MVStore.java:1022)
> at org.h2.mvstore.MVMap.readPage(MVMap.java:632)
> at org.h2.mvstore.MVMap.rewritePage(MVMap.java:682)
> at 
> org.h2.mvstore.FileStore.rewriteChunks(FileStore.java:1921)
> at 
> org.h2.mvstore.FileStore.compactRewrite(FileStore.java:1897)
> at 
> org.h2.mvstore.FileStore.rewriteChunks(FileStore.java:1858)
> at 
> org.h2.mvstore.RandomAccessStore.lambda$doHousekeeping$4(RandomAccessStore.java:726)
> at 
> org.h2.mvstore.MVStore.tryExecuteUnderStoreLock(MVStore.java:938)
> ... 3 more
> 2023-07-17 12:28:41 database: close
>
> среда, 12 июля 2023 г. в 08:30:44 UTC+3, Andreas Reichel: 
>
>> Greetings!
>>
>> On Tue, 2023-07-11 at 10:20 -0700, Vali Maties wrote:
>>
>> How do I upgrade it to be able to use the latest driver, as long as this 
>> one seems to be no more warnings in it!
>>
>>
>> You could use the H2 Migration Tool 
>> https://manticore-projects.com/H2MigrationTool/index.html
>>
>> Best regards
>> Andreas
>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/809493cb-932d-4632-b1e5-239485e0f7f6n%40googlegroups.com.


[h2] DB file size grows in an unexpected size (H2 version 1.4)

2023-04-18 Thread Jürgen Pingel
Hello,
we detect that the DB file size grows in an unexpected size. 
Following scenario:
 we have one DB file with ~30 tables where only ~10 tables regulary get 
changed (add, update and delete)
Before open the DB we log out the file size of the DB - mostly it was ~ 1GB.
But at some point the open DB grows up to ~5 GB - and for sure we don’t add 
so much data.
Does anybody know why that could happen?

Also we notice the following exception in the trace log file if we close 
the database:
org.h2.jdbc.JdbcSQLNonTransientException: Allgemeiner Fehler: "Allgemeiner 
Fehler: ""java.lang.IllegalStateException: File corrupt reading chunk at 
position 236937216 [1.4.200/6]""
General error: ""java.lang.IllegalStateException: File corrupt reading 
chunk at position 236937216 [1.4.200/6]"" [5-200]"
General error: "Allgemeiner Fehler: ""java.lang.IllegalStateException: File 
corrupt reading chunk at position 236937216 [1.4.200/6]""
General error: ""java.lang.IllegalStateException: File corrupt reading 
chunk at position 236937216 [1.4.200/6]"" [5-200]"; SQL statement:
shutdown [5-200]
at 
org.h2.engine.Database.throwLastBackgroundException(Database.java:2221)
at org.h2.engine.Session.close(Session.java:945)
at org.h2.engine.Session.suspend(Session.java:935)
at org.h2.engine.Database.closeAllSessionsExcept(Database.java:1325)
at org.h2.engine.Database.setExclusiveSession(Database.java:2571)
at 
org.h2.command.dml.TransactionCommand.update(TransactionCommand.java:89)
at org.h2.command.CommandContainer.update(CommandContainer.java:198)
at org.h2.command.Command.executeUpdate(Command.java:251)
at 
org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:168)
at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:126)

What happen there in H2 if such happen? Could this explain why the file 
grows up in that way?

Thanks for any help,
  Jürgen


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/4d99b80e-10ee-4f21-92b9-aaca08934a57n%40googlegroups.com.