[h2] Linked table issues (autocommit, prepared statement) ,modifications and licensing

2024-05-02 Thread Marat Akselrod
Hello,
I'd like to use H2 linked table function to data migration in way
insert into "linked target" as select from "linked source".
It will be very helpfull for our customers.
Technically it works , but I found some problems/issues(or maybe my 
misaunderstanidg)
1) Autocommit . Setting autocommit off sets autocommit only on 
TableLinkConnection object. But real connection is stored in 
TableLinkConnection conn property and so , remains "autocommited" by 
default. At least for Oracle driver, which I use.
To fix it I did some modification :
 a) to TableLinkConnection.setAutoCommit added 
this.conn.setAutoCommit(mode);
 b) It looks like  the commit statement has no affect on linked table so 
the previous change have caused the new issue - data was commited only on 
disconnected from the database (I'm not sure why , but maybe it's oracle's 
driver default bechavior to commit unsaved changes on closing of 
connection). In any case it's very problematic , so I have added another 
changes to 
Insert class insertRows() function 
if table instanceof TableLink and autocommit is disabled 
do commit 
just before 
table.fire(
the same change is in 
MergeUsing.update

2) Prepared statement 
 The LinkedIndex.add function (which builds sql) , appends "NULL" in value 
list every time when value is NULL. So for 10 rows with different columns 
with null value different sqls will be generated and so different  prepared 
stetements. So just now I have changed 
//buff.append("NULL");
buff.append('?');
params.add(v);
and 
prep.clearParameters(); in TableLink.execute in case and prepared statement 
is from pool

So,
Is it possible to make  changes in  the core 
to set autocommit  on real connection and execute real connection commit on 
COMMIT command(looks like logically it's a correct behavior ) ? 
and generate sql for prepared statements independent from the values ?

And if it can take a long, I want to understand if I'm allowed(by license) 
to provide to my customers my modified version meanwhile ?

Thanks in advance ,
Marat

-- 
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/332dfeb2-dc07-4622-9ede-7c0962cc4792n%40googlegroups.com.


[h2] Can aliases made by CREATE ALIAS , be retrieved by SQL?

2024-05-02 Thread Rinse Lemstra
Can aliases made by  CREATE ALIAS , be retrieved by SQL? 

could not find any documentation about this




also seached the system tables without any 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c930849a-c17c-4ddf-9356-03ad1f65aef8n%40googlegroups.com.


[h2] Re: Can aliases made by CREATE ALIAS , be retrieved by SQL?

2024-05-02 Thread Evgenij Ryazanov
Hello!

In H2 2.* you can read them from standard INFORMATION_SCHEMA.ROUTINES and 
INFORMATION_SCHEMA.PARAMETERS views.

In historic versions of H2 you need non-standard 
INFORMATION_SCHEMA.FUNCTION_ALIASES and INFORMATION_SCHEMA.FUNCTION_COLUMNS 
tables.

-- 
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/003e14f7-6e19-40b4-acd4-fe6a3cf4ee99n%40googlegroups.com.