[h2] When will a new version be released?

2024-05-31 Thread 'Olaf van der Meer' via H2 Database

Hi,

The last release is from Sept 2023? 
I have seen there are some patches since than. Does anyone know when a new 
versie will be released?

Thanks,
Olaf

-- 
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/7169104e-c3e1-4325-bab0-19bf83269e45n%40googlegroups.com.


[h2] Re: Error during database recover

2024-05-14 Thread 'Olaf van der Meer' via H2 Database

Hi,

I see it has been fixed Nov 26, 2023  
https://github.com/h2database/h2database/commit/51427805f05782adda33f3c1ccc464544e0d2273
 

by throwing a MVStoreException in Chunk.readChunkHeader()


Still have this question: I was also wondering where the mv.txt dump file 
is used for. I only need the h2.sql dump to recover the database.

Does anyone has got know when a new release will be released, so we can use 
this patch? The last release is from Sept 2023?

Thanks for you reply in advance!

Olaf

Op maandag 13 mei 2024 om 11:51:07 UTC+2 schreef Olaf van der Meer:

> Hi, 
>
> I am trying to repair a corrupt database, but the recover runs in an error:
> Caused by: java.lang.NullPointerException
> org.h2.mvstore.DataUtils.parseMap(DataUtils.java:804)
> org.h2.mvstore.Chunk.(Chunk.java:171)
> org.h2.mvstore.SFChunk.(SFChunk.java:26)
> org.h2.mvstore.MVStoreTool.dump(MVStoreTool.java:151)
> org.h2.tools.Recover.process(Recover.java:242)
> org.h2.tools.Recover.execute(Recover.java:226)
>
> I noticed someone else has report this too 
> https://github.com/h2database/h2database/issues/4020 
>
> I have looked into the MvStoreTool.java and changed the try .. catch 
> arround the line 151 to catch all exceptions: 
> try {
>   c = new SFChunk(Chunk.readChunkHeader(buffer));
> //} catch (MVStoreException e) {
> } catch (Exception e) {
> pos += blockSize;
> continue;
> }
>
> Now it can run further and the recover produces an h2.sql dump. 
> Is this a good fix for this issue?
>
> I was also wondering where wondering where the mv.txt dump file is used 
> for. 
> I only need the h2.sql dump to recover 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/138933a2-bea4-4ff1-bad3-c554f97bbb28n%40googlegroups.com.


[h2] Error during database recover

2024-05-13 Thread 'Olaf van der Meer' via H2 Database
Hi, 

I am trying to repair a corrupt database, but the recover runs in an error:
Caused by: java.lang.NullPointerException
org.h2.mvstore.DataUtils.parseMap(DataUtils.java:804)
org.h2.mvstore.Chunk.(Chunk.java:171)
org.h2.mvstore.SFChunk.(SFChunk.java:26)
org.h2.mvstore.MVStoreTool.dump(MVStoreTool.java:151)
org.h2.tools.Recover.process(Recover.java:242)
org.h2.tools.Recover.execute(Recover.java:226)

I noticed someone else has report this too 
https://github.com/h2database/h2database/issues/4020 

I have looked into the MvStoreTool.java and changed the try .. catch 
arround the line 151 to catch all exceptions: 
try {
  c = new SFChunk(Chunk.readChunkHeader(buffer));
//} catch (MVStoreException e) {
} catch (Exception e) {
pos += blockSize;
continue;
}

Now it can run further and the recover produces an h2.sql dump. 
Is this a good fix for this issue?

I was also wondering where wondering where the mv.txt dump file is used 
for. 
I only need the h2.sql dump to recover 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/e9d0e929-1608-4284-8b65-4483b1b950c5n%40googlegroups.com.


[h2] concurrent queries

2024-03-12 Thread 'Olaf van der Meer' via H2 Database
Hi,

I am using H2 1.4. Is it correct that H2 can execute only one query at the 
time on the same table/database?

We see that concurrent queries (on the same database, same table) are 
waiting on each other.
As long as a (long running) query is busy, the h2 engine does not execute 
another query on the same database.

Is this observation correct, or is our code not correct for this situation.

thanks in advance,

Olaf

-- 
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/a7554c2a-e012-470a-b639-1b0cb13c64c1n%40googlegroups.com.


[h2] Concurrent queries

2024-03-12 Thread 'Olaf van der Meer' via H2 Database
Hi,

I am using H2 1.4.190.  Is it correct that H2 can execute only one query at 
the time on the same table/database?

We see that concurrent queries (on the same database, same table) are 
waiting on each other.

Is this observation correct, or is our code not correct for this situation.

thanks in advance,

OlafHi,

I am using H2 1.4. Is it correct that H2 can execute only one query at the 
time on the same table/database?

We see that concurrent queries (on the same database, same table) are 
waiting on each other.
As long as a (long running) query is busy, the h2 engine does not execute 
another query on the same database.

Is this observation correct, or is our code not correct for this situation.

thanks in advance,

Olaf

-- 
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/de468235-5389-44c9-a31f-7c0634d0n%40googlegroups.com.


[h2] Userdefined functions and synchronized

2024-02-27 Thread 'Olaf van der Meer' via H2 Database
Hi,

I am using some user defined functions like this:

public static boolean isPrime(int value) {
return BigInteger.valueOf(value).isProbablePrime(100);
}

public static ResultSet query(Connection conn, String sql) throws 
SQLException {
return conn.createStatement().executeQuery(sql);
}

As for as I know it is better to avoid public static functions in a multi 
threaded application and it is betterto maken that methods synchronized 
like this:

public synchronized static boolean isPrime(int value) {
return BigInteger.valueOf(value).isProbablePrime(100);
}

public synchronized static ResultSet query(Connection conn, String sql) 
throws SQLException {
return conn.createStatement().executeQuery(sql);
}

Sometimes our server has a deadlock on some user defined functions. I think 
it is because I made them synchronized. 

What do you think?
Hope somebody give some advice about this. 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/9ea916f4-623b-4cf9-9f53-6672314a7dbfn%40googlegroups.com.


[h2] Timeout trying to lock table when using transactions

2023-04-13 Thread 'Olaf van der Meer' via H2 Database

Hi, 

A Timeout trying to lock table "SYSTEEM" error occurs in the next situation:


dbConnectionA is in transaction ( using setAutoCommit( false ) )
dbConnectionB is NOT in transaction 

dbConnectionA is used to save some data (for instance an invoice )
dbConnectionB is used to create unique numbers (like invoice nr for 
instance)

saveInvoice()
{
dbConnectionA.startTransaction();
try
{
Invoice invoice = new Invoice();
invoice.setDueDate( getDueDate( dbConnectionA ) );

invoice.setNr( getNextInvNr( dbConnectionB ) ); // Timeout trying to lock 
table "SYSTEEM";
invoice.save(dbConnectionA); 

//and save its details

dbConnectionA.commitTransaction();
}
finally
{
if ( !dbConnectionA.isTransactionCommitted() )
dbConnectionA.rollBackTransaction();
}
}

public static synchronized getNextInvNr( dbCon ){
// Reads the next invoice number from 'SYSTEEM' and returns is
// It also increases this number in the table 'SYSTEEM' and save it to the 
database.
// I use a public static synchronized method to synchronize multiple users 
(Threads)
}

getDueDate(){
// reads due date from table 'SYSTEEM' and returns it
}



I discovered, that if I do read the getDueDate( dbConnectionA ) the error 
does not occur.
Is it logically reading from a table using a connection which is in 
transaction is creating a lock on the table and causes this error?

If I don't start a transaction the error does not occurs either. 


I am using a bit old h2database version: 1.4.190.
And using this properties: 
..\Data;FILE_LOCK=NO;MV_STORE=FALSE;MODE=REGULAR;CACHE_SIZE=16384;DB_CLOSE_DELAY=0;IGNORECASE=TRUE;DATABASE_TO_UPPER=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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/b4ad141e-b83d-49f4-b512-c6404fa2ac2dn%40googlegroups.com.


[h2] Timeout trying to lock table, when using transactions

2023-04-13 Thread 'Olaf van der Meer' via H2 Database
Hi, 

A Timeout trying to lock table "SYSTEEM" error occurs in the next situation:


dbConnectionA is in transaction ( using setAutoCommit( false ) )
dbConnectionB is NOT in transaction 

dbConnectionA is used to save some data (for instance an invoice )
dbConnectionB is used to create unique numbers (like invoice nr for 
instance)

saveInvoice()
{
dbConnectionA.startTransaction();
try
{
Invoice invoice = new Invoice();
invoice.setDueDate( getDueDate( dbConnectionA ) );

invoice.setNr( getNextInvNr( dbConnectionB ) ); // Timeout trying to lock 
table "SYSTEEM";
invoice.save(dbConnectionA); 

//and save its details

dbConnectionA.commitTransaction();
}
finally
{
if ( !dbConnectionA.isTransactionCommitted() )
dbConnectionA.rollBackTransaction();
}
}

public static synchronized getNextInvNr( dbCon ){
// Reads the next invoice number from 'SYSTEEM' and returns is
// It also increases this number in the table 'SYSTEEM' and save it to the 
database.
// I use a public static synchronized method to synchronize multiple users 
(Threads)
}

getDueDate(){
// reads due date from table 'SYSTEEM' and returns it
}



I discovered, that if I do read the getDueDate( dbConnectionA ) the error 
does not occur.
Is it logically reading from a table using a connection which is in 
transaction is creating a lock on the table and causes this error?

If I don't start a transaction the error does not occurs either. 


I am using a bit old h2database version: 1.4.190.
And using this properties: 
..\Data;FILE_LOCK=NO;MV_STORE=FALSE;MODE=REGULAR;CACHE_SIZE=16384;DB_CLOSE_DELAY=0;IGNORECASE=TRUE;DATABASE_TO_UPPER=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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/14d990d0-3a6e-451e-b5ea-a317ad6443ban%40googlegroups.com.