[h2] Re: Connect to h2 server using SSL

2019-10-30 Thread Evgenij Ryazanov
Oracle disabled anonymous suits due to security reasons. https://bugs.openjdk.java.net/browse/JDK-8213090 You you can't use older JRE you need to create a key store and set system properties javax.net.ssl.keyStore and javax.net.ssl.keyStorePassword. -- You received this message because you are

[h2] Re: A negative scale value produces incorrect precision and scale values

2019-10-29 Thread Evgenij Ryazanov
Hello. Scale should be unsigned according to the SQL Standard, so such definition is invalid. On the other hand, H2 supports the negative scale in numeric data types and such support was broken by accident. -- You received this message because you are subscribed to the Google Groups "H2

[h2] Re: using ALIAS function in a select

2019-10-29 Thread Evgenij Ryazanov
Hello. Please, take a look on the documentation of identifiers: https://h2database.com/html/grammar.html#name You need to use "firstDay" and "lastDay" with double quotes instead, because "firstDay" and firstDay = "FIRSTDAY" are different identifiers. -- You received this message because you

[h2] Re: Interval day to second feature not supported in H2 1.4.199

2019-10-24 Thread Evgenij Ryazanov
According to the SQL Standard, result of subtraction of one datetime value from another is an interval, but Oracle violates the Standard and returns a DATE JULIAN for (DATE - DATE) and NUMBER for (TIMESTAMP - TIMESTAMP) for historic reasons. H2 does not provide compatibility on that level,

[h2] Re: Interval day to second feature not supported in H2 1.4.199

2019-10-24 Thread Evgenij Ryazanov
Hello. I think it can be caused only by invalid SQL that was used with the old version of H2 as a workaround over its missing features, and that workaround doesn't work any more; or by some other invalid SQL expression that somehow worked in the old version. You need to show us your query,

[h2] Re: Connect to h2 server using SSL

2019-10-23 Thread Evgenij Ryazanov
Hello. H2 uses the anonymous SSL by default on older Java versions up to 10, unless a security manager prevents it. It also doesn't work on Java 11+ due to changes in JDK. https://github.com/h2database/h2database/issues/1303 I have multiple installations of different versions of Java, and in

[h2] Re: ALIAS function not supporting Number parameter type

2019-10-23 Thread Evgenij Ryazanov
Hello. java.lang.Number is an abstract class in Java that has different implementations, such as `BigInteger`, `BigDecimal`, wrappers over primitive data types and you can create your own implementations too. So, technically, it can hold everything. This data type is not supported by JDBC. It

[h2] Re: Can't create full text index (H2: v1.4.200 , lucene: v7.7.2 or v8.2.0)

2019-10-16 Thread Evgenij Ryazanov
The situation is even worse, the binary compatibility with 6 is broken too. So you need to use 5.5.5 (it was used for compilation of official release of H2 1.4.200), or you can build H2 from its current sources if you definitely need a newer version of Lucene for a some reason. -- You

[h2] Re: Can't create full text index (H2: v1.4.200 , lucene: v7.7.2 or v8.2.0)

2019-10-16 Thread Evgenij Ryazanov
Oh, I see. We definitely have a problem. Try some older version of Lucene such as 6.6.*. 7.0.0 and newer versions are source compatible but binary incompatible, if you need them, you need to recompile H2 with that version. I'll try to fix the binary compatibility for a next version of H2. I

[h2] Re: Can't create full text index (H2: v1.4.200 , lucene: v7.7.2 or v8.2.0)

2019-10-15 Thread Evgenij Ryazanov
Hello. I cannot reproduce this issue with Lucene 7.7.1 and Lucene 8.0.0. I can test 7.7.2 and 8.2.0 too, but I don't think that results will be different. You need to click on the error message to see the complete stack trace, it could describe the situation better. Most likely you don't

[h2] Re: VARCHAR comparison and trailing spaces

2019-10-09 Thread Evgenij Ryazanov
In some other use cases such strength is required for normal operation and it is configurable in H2, but only in a new empty database, to change it later database needs to be exported to SQL, edited (with some stream editor) and re-created. -- You received this message because you are

[h2] Re: VARCHAR comparison and trailing spaces

2019-10-09 Thread Evgenij Ryazanov
Hello. The current version of the SQL Standard is SQL:2016 plus corrigenda and additional parts from 2019. Please, don't talk about SQL-92, it is completely outdated, there are six (!) versions that were published after it. I don't have the very recent version of ISO/IEC 9075-2, but in

Re: [h2] Re: Inserting text into a blob in H2

2019-10-08 Thread Evgenij Ryazanov
BLOB or CLOB values in in-memory database? Bad idea in general, when you use an in-memory database, it should be small enough. If you want to connect to the database from another process, you need to start a TCP Server inside of the process that owns the database. org.h2.tools.Server tcp =

[h2] Re: Inserting text into a blob in H2

2019-10-08 Thread Evgenij Ryazanov
Hello. H2 is not different from others, JDBC has java.sql.Blob interface that should be used, use Collection.createBlob() to allocate a BLOB instance, use one of its methods to put your data into it, and use PreparedStatement.setBlob() to pass this BLOB to the command. There are also an

[h2] Re: "SELECT ... WHERE ... IN" on extremely large tables

2019-10-07 Thread Evgenij Ryazanov
BTW, what version of H2 do you use? IN (query) condition needs a lot of memory in 1.4.197 and older versions. -- 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] Re: Failed to change "not null" option on a column on version 1.4.199

2019-10-07 Thread Evgenij Ryazanov
Hello. Your command is definitely not valid. Where did you find it? We don't have such syntax in the documentation. It was accepted due to bug. Use ALTER TABLE tableName ALTER COLUMN columnName SET NOT NULL instead. The SET DATA TYPE clause may be used only to change the data type of the

[h2] Re: Compatibility modes

2019-09-29 Thread Evgenij Ryazanov
Hello. On Sunday, 29 September 2019 18:09:22 UTC+8, pr1 wrote: > > Hello, > could someone explain the compatibility modes in H2? > If you use the Oracle-db driver in H2, must you write you SQL statements > using the Oracle-SQL syntax? > What exactly do you mean? If you use the H2 Console to

[h2] Re: Admin rights issue

2019-09-29 Thread Evgenij Ryazanov
Hello. When you created this database a user with ADMIN rights were created using the user name and password that were specified to create a first connection. You need to use its user name and password to connect to the database. After it you can either execute this script under that account

[h2] Re: Generic H2 Configuration Gone

2019-09-26 Thread Evgenij Ryazanov
Hello. You can type a some name of the setting, org.h2.Driver as a driver, your JDBC URL and user name and save such custom setting. Predefined settings aren't intended to be used as is, they are just templates. Another solution is to edit the configuration file. The configuration is stored

[h2] Re: Drop a database

2019-09-26 Thread Evgenij Ryazanov
Hello. If you have a connection, use DROP ALL OBJECTS DELETE FILES https://h2database.com/html/commands.html#drop_all_objects If there are no active connections, you can delete file(s) with DeleteDbFiles or by yourself. https://h2database.com/javadoc/org/h2/tools/DeleteDbFiles.html -- You

[h2] Re: H2 1.4.196 and free space allocated

2019-09-20 Thread Evgenij Ryazanov
Hello. 1.4.196 is an old unsupported version. You should try 1.4.199 first, it has some improvements in that area. However, MVStore is not the best storage for massive insertions quickly followed by massive updates and massive deletions and so on. It is more suitable for normal use cases. It

[h2] Re: Can CSVREAD use direct data as argument?

2019-09-18 Thread Evgenij Ryazanov
That's not supported. You can create an own user-defined function and use Csv.read(Reader, String[]) in it as a workaround, but if you'll do so, you will need to check compatibility of your code with next versions of H2 before an upgrade. -- You received this message because you are

[h2] Re: CSVREAD looses column (1.4.196)

2019-09-18 Thread Evgenij Ryazanov
Sorry, it isn't fixed yet. Of course, you may submit a pull request with a fix if you wish. The relevant code is in org.h2.tools.Csv. -- 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

[h2] Re: CSVREAD creates uppercased column names for single word names

2019-09-13 Thread Evgenij Ryazanov
On Saturday, 14 September 2019 04:28:30 UTC+8, George Ivanov wrote: > > sure! should one use caseSensitiveColumnNames anywhere else too? > I'm not sure what do you mean, but if you use quoted names of columns (" ColumnName") in your SQL commands, they are case sensitive by default. -- You

[h2] Re: CSVREAD creates uppercased column names for single word names

2019-09-12 Thread Evgenij Ryazanov
I meant caseSensitiveColumnNames=true, of course. -- 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

[h2] Re: CSVREAD creates uppercased column names for single word names

2019-09-12 Thread Evgenij Ryazanov
No, it's not a bug. Such behavior is documented, but in obscure way: https://h2database.com/html/functions.html#csvread Use caseSensitiveColumnNames option if you want to preserve case of column names unconditionally. CSVREAD('filename.csv', NULL, 'caseSensitiveColumnNames=false') -- You

Re: [h2] My sequences are not in the correct order

2019-08-20 Thread Evgenij Ryazanov
> > Do you have an option to enable this on h2? > What exactly do you want to enable? You can use GENERATED BY DEFAULT AS IDENTITY (CACHE 1) instead of AUTO_INCREMENT to disable the cache of the sequence. The default cache size is 32. Cached identities may be lost on abnormal termination of the

Re: [h2] Re: LINEKED TABLE contains a select query to a row name with slachs

2019-08-20 Thread Evgenij Ryazanov
Could you try to build H2 from its current sources and re-test your code? Sources are here: https://github.com/h2database/h2database Building instructions are here: https://h2database.com/html/build.html#building You need the jar target. -- You received this message because you are subscribed

[h2] Re: LINEKED TABLE contains a select query to a row name with slachs

2019-08-14 Thread Evgenij Ryazanov
Hello. It looks like the problem is caused by H2's attempt to fetch metadata of the source table. H2 tries to pass its name as is even when it definitely is a query and not a plain name. I filled an issue about it on GitHub: https://github.com/h2database/h2database/issues/2073 I don't think

[h2] Re: PREPAREDSTATMENT - SCRIPT COLUMNS HELP

2019-08-08 Thread Evgenij Ryazanov
You don't need a COLUMNS clause. It only changes insert statements from INSERT INTO TBL VALUES (1, 2, 3) to INSERT INTO TBL (A, B, C) VALUES (1, 2, 3), it can be useful if you want to load the script into some other database that don't support insert statements without names of columns. I only

[h2] Re: UPDATE MY DATABASE WITH BACKUPSCRIPT

2019-08-08 Thread Evgenij Ryazanov
Hello. H2 can export a database in two formats. 1. Regular backup (BACKUP TO 'filename.zip'). You can unpack the generated archive and use it as a database. 2. Export format (SCRIPT TO 'filename.sql'). You can execute it in a new empty database with RUNSCRIPT FROM 'filename.sql'. So you need

Re: [h2] Re: CSVREAD looses column (1.4.196)

2019-08-08 Thread Evgenij Ryazanov
Both lines have 3 columns, it's just a bug in Csv.readHeader() / Csv.readValue(). -- 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] Re: CSVREAD looses column (1.4.196)

2019-08-08 Thread Evgenij Ryazanov
Hello. Yes, it looks like a bug. You can use some non-empty name of the last column as a workaround. A,B,C 0, 1, 2 -- 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

[h2] Re: JdbcSQLNonTransientException: Unknown data type

2019-08-07 Thread Evgenij Ryazanov
Hello. H2 compiles your query immediately, so it needs to know the data types of *some* arguments. The usual workaround is to wrap the parameter into CAST function. This function doesn't need to know the type of its argument. SELECT * FROM (SELECT CAST(? AS INT)) Of course, you need to know

[h2] Re: Syntax error in 1.4.197

2019-08-06 Thread Evgenij Ryazanov
BTW, take a look on the section “Prepared Statements and IN(...)” in the documentation: https://h2database.com/html/performance.html#database_performance_tuning Please note that ANY(?) is a non-standard PostgreSQL-style feature that is supported since H2 1.4.197. It can be not suitable for

[h2] Re: Syntax error in 1.4.197

2019-08-06 Thread Evgenij Ryazanov
Hello. IN predicate with empty list is not valid according to the SQL Standard. However, some databases, including H2, support it. H2 1.4.193 and later versions don't allow it in DB2, MySQL, Oracle, and PostgreSQL compatibility modes because these databases don't allow it. When you use a

[h2] Re: DROP COLUMN cause table table to disappear

2019-08-06 Thread Evgenij Ryazanov
1.4.196 and older versions have a problem with some constraints. This issue was fixed in 1.4.197, but the fix isn't fully compatible with older databases. Execution of DDL command in 1.4.197 in the database that was initially created by some older version may corrupt a database. This issue was

[h2] Re: H2 Trigger doesn't Trigger properly

2019-08-05 Thread Evgenij Ryazanov
OK, let's test it with JDBC: import java.sql.*; import org.h2.api.Trigger; public class TestTrigger { public static class T implements Trigger { @Override public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before,

Re: [h2] Unit test result differs in 1.4.188 Vs 1.4.198

2019-08-05 Thread Evgenij Ryazanov
If you have a problem with some implementation of JPA it's better to post your question on StackOverflow with appropriate tags or in some other place where your question will be visible by many people familiar with JPA, Hibernate and other related stuff. I have no idea how to while a correct

Re: [h2] Unit test result differs in 1.4.188 Vs 1.4.198

2019-08-05 Thread Evgenij Ryazanov
I assume you understand that order of results in queries without ORDER BY can be changed again at any time. It's better to change tests in order-independent way. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group

Re: [h2] Unit test result differs in 1.4.188 Vs 1.4.198

2019-08-05 Thread Evgenij Ryazanov
Most likely the results will be the same as in 1.4.199. But 1.4.199 is more reliable in other areas. You can also sort the results by your own in your test cases. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group

Re: [h2] Unit test result differs in 1.4.188 Vs 1.4.198

2019-08-05 Thread Evgenij Ryazanov
1.4.197 and 1.4.198(199) are huge releases with a lot of changes. BTW, don't use 1.4.198, this release has many regressions, it was replaced with 1.4.199. Some queries may return result in different orders on Java 7 and on later versions. Some queries may change the order of results depending

[h2] Re: H2 Trigger doesn't Trigger properly

2019-08-04 Thread Evgenij Ryazanov
Hello. On Sunday, 4 August 2019 23:48:40 UTC+8, Piotr wrote: > > I've created trigger: > > CREATE TRIGGER update_date Before INSERT ON notes FOR EACH ROW CALL > TriggerBeforeInsert.class.getName() > > I would like to set the version field to 1 whenever a new record is > inserted. Here is the

[h2] Re: error

2019-08-04 Thread Evgenij Ryazanov
Hello. It's just a bad error message, it shouldn't mention the IFEXISTS parameter. The next version will throw a better message. Recent versions of H2 don't allow remote creation of databases any more due to security reasons. You need to create the new empty database in some other way.

[h2] Re: Investigation on the diffusion of innovation along with java releases

2019-07-31 Thread Evgenij Ryazanov
Hello. I think you don't understand well what is API of a database engine or its driver and what is not. Code of H2 is not used directly with few exclusions. Databases are accessed by Java programs with a JDBC. JDBC is described by the JDBC Specification and its classes are located in java.sql

[h2] Re: Migrating from 1.3.x to 1.4.196

2019-07-31 Thread Evgenij Ryazanov
Hello. 1. You use an old unsupported version with known issues, including issue with unreasonably large databases after execution of huge queries. Only issues with 1.4.199 are accepted. Note that there are some issues with automatic upgrade, it's safer to create a new database and populate it

[h2] Re: Password

2019-07-20 Thread Evgenij Ryazanov
Hello. If you have an icon of H2 Console in the system tray, you can launch a browser session from it by double click or from its context menu. In this session you will be able to use these utilities without an additional authentication and also will be able to create a new database. If you

[h2] Re: the database grows

2019-07-17 Thread Evgenij Ryazanov
Maybe your SELECT statement returns some LOBs or it has FOR UPDATE clause? Otherwise it should not affect the size of database in any way. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails

[h2] Re: 1.3.172 vs 1.4.199

2019-07-17 Thread Evgenij Ryazanov
Hello. Your version is very old. Automatic upgrade is not always clean. You need to export your database to SQL with a SCRIPT TO 'filename.sql' command using 1.3.172. After in you can create a new database with 1.4.199 and execute RUNSCRIPT FROM 'filename.sql' to populate it with your data.

[h2] Re: mapping interval to duration

2019-07-16 Thread Evgenij Ryazanov
Hello. You need to use getObject(1, Duration.class); -- 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

Re: [h2] Corrupt Database Chunk Wont Recover

2019-07-13 Thread Evgenij Ryazanov
Building instructions are here: https://h2database.com/html/build.html#building However, you you can load the sources from h2/src/main into any Java IDE and launch the recovery process directly from the IDE. When you see a failure that isn't handled automatically you can add some try-catch

[h2] Re: How do I safely interrupt a mid flight transaction?

2019-07-04 Thread Evgenij Ryazanov
Thread.interrupt() is a way to database corruption. Take a look on the SHUTDOWN command: https://h2database.com/html/commands.html#shutdown You can execute this command and wait for its completion. After its execution you can interrupt your threads as you wish. Of course, you need to prevent

[h2] Re: Function "LEAD" not found.

2019-07-02 Thread Evgenij Ryazanov
Hello. Window functions aren't available in old versions of H2, only 1.4.198 and 1.4.199 have them. 1.4.198 has a lot of regressions, so use 1.4.199. Online documentation in both HTML and PDF formats covers only the latest available version. When you use some older version you need to use the

Re: [h2] H2 corrupted DB

2019-06-22 Thread Evgenij Ryazanov
> > We do actually make a copy of the file, but we call SET EXCLUSIVE 1 before > we do that. It does not matter, such copy may still be unusable. Database can write something in background and copy can read inconsistent older and newer data. If you really want to copy the file, you need to

[h2] Re: Full text Lucene not working with last version

2019-06-19 Thread Evgenij Ryazanov
> > The indexes I created using the older versions don't seem to work anymore. They aren't compatible with newer versions of Lucene. They should be re-created, but it may take some time. We are still considering sticking to the older version (1.3.160 with > lucene-core 3.4.0 for compatibility

[h2] Re: Full text Lucene not working with last version

2019-06-18 Thread Evgenij Ryazanov
Hello. There is a bug in latest releases of H2 and very recent releases of Lucene aren't really supported. You can build H2 from its current sources if you need them for a some reason. Lucene 5.5.5 should work in released versions properly. Exception that you see means that your classpath

[h2] Re: Corrupted database - new scenario

2019-06-17 Thread Evgenij Ryazanov
Unfortunately, this tool exports medatadata (that may contain unquoted identifiers) as is. Databases that were created by 1.4.199 should not be affected. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop

[h2] Re: Corrupted database - new scenario

2019-06-14 Thread Evgenij Ryazanov
Unfortunately, you need to enclose the "TABLE" into parentheses here with a some text editor. It is a new keyword. Recent versions of H2 can load old databases with such unquoted identifiers, but they can't load a script that contains them. Recent versions also always quote all identifiers

[h2] Re: generated keys are "cleared" inside of Session during INSERT (to the table with AUTOINCREMENT column) when there is a trigger (Java code, obviously) that does another INSERT (to different tab

2019-06-13 Thread Evgenij Ryazanov
Hello. No, it's not a TODO. It's a comment why the conditions below are necessary. Nested DML commands weren't not supported. However, the current implementation is entirely different and hypothetically it should work in your use case. You can build H2 from the sources and test it with your

[h2] Re: Nested transactions - do they exist? Cannot find any documentation about this

2019-06-12 Thread Evgenij Ryazanov
Hello. You can't nest one transaction into another in H2, but you can use a savepoint inside a transaction. -- some work SAVEPOINT name; -- some work -- Reverts to the specified savepoint ROLLBACK TO SAVEPOINT name; -- Reverts the whole transaction ROLLBACK;

[h2] Re: Wrong user name or password on freshly installed h2 database

2019-06-07 Thread Evgenij Ryazanov
You can also change the file name in JDBC URL to a different one to create a new 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] Re: Wrong user name or password on freshly installed h2 database

2019-06-07 Thread Evgenij Ryazanov
Hello. > > It looks like you already have a database in the file with name test.h2.db or test.mv.db in your home directory and that database doesn't have a user with same sa and empty password. If you need this database, use the recovery tool, it should be able to restore unencrypted database

[h2] Re: FORMATDATETIME produces incorrect hour

2019-05-15 Thread Evgenij Ryazanov
Hello. It looks like your timezone has a DST transition from 2019-03-10 02:00:00 to 2019-03-10 03:00:00, so timestamp 2019-03-10 02:00:00 is not valid. This function always normalizes such timestamps. You can use the TIMESTAMP WITH TIME ZONE data type to avoid issues on DST boundaries. SET

Re: [h2] Re: Recent drops in performance

2019-05-05 Thread Evgenij Ryazanov
PreparedStatement re-parses such queries during each invocation. And we also have another known problem with CTEs: temporary views from different statements may conflict with each other. Such views should not be visible outside of the command. -- You received this message because you are

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
org.h2.table.TableView.destroyShadowTableForRecursiveExpression (boolean, org.h2.engine.Session, org.h2.table.Table) calls org.h2.engine.Session.removeLocalTempTable (org.h2.table.Table) that calls org.h2.engine.Database.lockMeta (org.h2.engine.Session) We have a bottleneck here. -- You

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
Previous message was truncated, so check the attachment. -- 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

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
I run a git bisect. https://github.com/h2database/h2database/commit/7977b90bd13e9088a3dc1ed8b60efb2699e97724 is the first slow commit. It was merged in https://github.com/h2database/h2database/pull/640 -- You received this message because you are subscribed to the Google Groups "H2 Database"

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
With 200 threads both 1.4.197 and 1.4.199 work about 6–7 times slower than 1.4.196. -- 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

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
I used the same query as in you test case. I can repeat the test with 200 threads. -- 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

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
I wrote and run a simple 4-thread test with 4 connections and 4 prepared statements with values from population.csv. I tested all values distributed between these threads (All) and also 10,000 randomly selected values per thread (Random). Measured times in seconds are average times between

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
We need code that can be profiled directly with any suitable tool. But not the third-party environment that does something with the web interface of H2. It looks like population.csv contains the identities that should be passed to the provided query, but I'm not sure. -- You received this

Re: [h2] Re: Recent drops in performance

2019-05-04 Thread Evgenij Ryazanov
We need a standalone test case (Java/SQL only) for further investigation. -- 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] Re: What is the latest stable release?

2019-05-03 Thread Evgenij Ryazanov
Hello. If your database is in PageStore format you need to export it to SQL script with 1.4.196, create a new database with a new version and populate it with this script due to issue #1247. https://github.com/h2database/h2database/issues/1247

Re: [h2] Re: Recent drops in performance

2019-05-03 Thread Evgenij Ryazanov
Hello. Your cte.sql contains runscript from 'init.sql'; Do you measure performance of the query or performance of database population with data? I don't see any noticeable differences in execution time of the query itself between 1.4.196 and 1.4.199 in both PageStore and MVStore databases

[h2] Re: Removal of SELECT_FOR_UPDATE_MVCC 1.4.197 -> 1.4.199

2019-05-03 Thread Evgenij Ryazanov
BTW, you can't lock rows that don't exist, so if there were no rows with the specific report_id your select will be unsafe (unless you use some additional locking in this corner case). -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To

[h2] Re: Removal of SELECT_FOR_UPDATE_MVCC 1.4.197 -> 1.4.199

2019-05-03 Thread Evgenij Ryazanov
It's not related in any way with compatibility modes. Perhaps you can lock the rows in a subquery. select coalesce(max(sequence) + 1, 1) from (select sequence from r where r.report_id = ? for update) -- You received this message because you are subscribed to the Google Groups "H2 Database"

[h2] Re: Removal of SELECT_FOR_UPDATE_MVCC 1.4.197 -> 1.4.199

2019-05-03 Thread Evgenij Ryazanov
Hello. SELECT_FOR_UPDATE_MVCC was useless after other changes in H2. The exception that you got describes the situation pretty clear: you can't use FOR UPDATE clause when you use aggregates (or distinct). Grouped queries don't return the original rows, FOR UPDATE is disallowed in such queries

[h2] Re: Req: make FROM optional in DELETE statement

2019-05-01 Thread Evgenij Ryazanov
So you use either Oracle or H2 in MySQL compatibility mode? It's a pretty strange choice, you're just looking for trouble. If your query looks like SELECT DISTINCT A FROM someTable ORDER BY someFunction(A) you don't need a compatibility mode, such query is accepted by H2 since 1.4.198. (But

[h2] Re: Req: make FROM optional in DELETE statement

2019-04-28 Thread Evgenij Ryazanov
Sorry, I was wrong and H2 actually accepts DELETE without FROM in all versions available on Maven Central. The only exclusion is MySQL compatibility mode. In this mode recent versions of H2 do not accept DELETE without FROM, older versions accept it too. Because MySQL does not accept it, this

[h2] Re: Req: make FROM optional in DELETE statement

2019-04-27 Thread Evgenij Ryazanov
Hello. What version of H2 do you use? H2 incorrectly accepts DELETE without FROM in all modes except MySQL compatibility mode since version 1.4.197 I guess. This is caused by incorrect implementation of feature request 585 for MySQL compatibility:

[h2] Re: Recent drops in performance

2019-04-26 Thread Evgenij Ryazanov
Hello. CTEs are experimental in H2 and have known bugs, recent versions contain some fixes, so this performance drop may be somehow related with them. But older versions of H2 do not support CTEs at all, so I don't understand how you can test a feature that does not exist. We still need a

[h2] Re: classes found in the wrong directory

2019-04-26 Thread Evgenij Ryazanov
I think you need to discuss your problem with developers of software that you use. A lot of modern libraries are packed in multi-release jars, they should support them properly. Of course, you can create an own repository somewhere and place a patched jar into it, or use some other way. But

[h2] Re: Corrupted databases revisited

2019-04-25 Thread Evgenij Ryazanov
There is a DB_CLOSE_ON_EXIT setting. It in enabled by default, but it can be disabled. SHUTDOWN command may be executed with other alive connections, they will be closed too, but it's possible that an application will reopen the database after execution of this command, you need to prevent it

[h2] Re: Corrupted databases revisited

2019-04-25 Thread Evgenij Ryazanov
Hello. No, you can't copy a database file if database was not closed properly, but you can use a SHUTDOWN command to close it. However, if you need a backup copy it can be created with BACKUP TO 'filename.zip' command, there is no reason to close other connections for it. Usually it's safe to

Re: [h2] Re: H2 for Raspberry PI and ARM

2019-04-22 Thread Evgenij Ryazanov
Hello. Standalone MVStore is not a database at all. It's just a copy-on-write key-value storage with multiple maps and optional transactions (with TransactionStore). Of course, you can iterate over MVMap from MVStore by your own code and perform some computations, but I guess it's not that you

[h2] Unsupported connection setting DATABASE_TO_LOWER

2019-04-20 Thread Evgenij Ryazanov
This setting is only supported by latest versions of H2, 1.4.197 does not have it. You need to upgrade to 1.4.199. If you're required to use 1.4.197 you can use DATABASE_TO_UPPER=FALSE instead, but it works in different way. -- You received this message because you are subscribed to the

[h2] Re: Corrupted databases with 1.4.199

2019-04-12 Thread Evgenij Ryazanov
Hello. Error code 1.4.196/1 clearly indicates that exception was thrown by 1.4.196 and not by 1.4.199. You need to check your environment, it looks like you still use 1.4.196 somewhere. Maybe you have multiple jars in your classpath. However, it's reasonable to export your database into a SQL

[h2] Re: Bug: sql grammar variably enforced

2019-04-11 Thread Evgenij Ryazanov
Hello. Unfortunately, H2 detects such problems with GROUP BY only when more than one distinct value for a column was selected. It's an old known limitation that is not fixed yet. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe

[h2] Re: Urgent : Database Corrupt problem randomly on many computer.

2019-04-09 Thread Evgenij Ryazanov
Hello. The whole database file is filled with zeroes. I have no idea why your data was erased, such file does not look like being produced by H2. H2 always write at least own headers, even empty databases have them. Do you have some other code or some other software that can access the

[h2] Re: classes found in the wrong directory

2019-04-05 Thread Evgenij Ryazanov
H2 is still fully compatible with Java 7. This problem is not related with Java. But atlassian-plugin or some other piece of software that you use performs incorrect unexpected checks and needs to be fixed to be compatible with multi-release jars. And yes, you can remove the entire

[h2] Re: Bug alias for column in query

2019-04-04 Thread Evgenij Ryazanov
Hello. How exactly do you read names of aliases? I cannot reproduce this issue in 1.4.197 and in other versions. try (Connection c = DriverManager.getConnection("jdbc:h2:mem:1")) { Statement s = c.createStatement(); s.execute("CREATE TABLE test (ID int);");

[h2] Re: classes found in the wrong directory

2019-04-04 Thread Evgenij Ryazanov
It looks like software that you use does not support Multi-release jar files: https://openjdk.java.net/jeps/238 Multi-relese jars are very common now. If you use the latest version of that software, check its bugtracker and post a new issue in it, if such issue does not exist yet. You can

[h2] Re: SET SCHEMA FOR REMOTE CONNECTION THROWING ERROR [ Feature not supported: "setSchema && remote session"]

2019-04-04 Thread Evgenij Ryazanov
Hello. You can execute SET SCHEMA name command or add schema to a database URL (;SCHEMA=name). Connection.getSchema() and Connection.setSchema() work only with embedded databases and don't work over TCP (I don't know why). -- You received this message because you are subscribed to the Google

[h2] Re: how to trigger serialization of data objects contained in MVStore Collections

2019-04-02 Thread Evgenij Ryazanov
Hello. That's not possible. Why you need a HashMap inside of MVMap? I think you should create a separate MVMap for user_accounts content, in this case you can simply put the modified object into it and only that object will be serialized. -- You received this message because you are

[h2] Re: Recent drops in performance

2019-03-28 Thread Evgenij Ryazanov
Hello. Could you build a standalone test case that can be used to reproduce such slowdown? I don't see any reasons for it. -- 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

[h2] Re: Linked Tables & Indexes

2019-03-27 Thread Evgenij Ryazanov
Database B will pass some commands to database A, how they will be actually executed and how indexes will affect execution plan is a problem of database A, database B has nothing to do with it. -- You received this message because you are subscribed to the Google Groups "H2 Database" group.

[h2] Re: Linked Tables & Indexes

2019-03-26 Thread Evgenij Ryazanov
Hello. You can see these indexes only in the source database and only the source database can use them. The linked table simply delegates queries and modification commands to the source database using its own auto-generated SELECT, INSERT, UPDATE, or DELETE commands. -- You received this

[h2] Re: Explanation about LAZY_QUERY_EXECUTION

2019-03-26 Thread Evgenij Ryazanov
Hello. AFAIK, this feature was implemented for Apache Ignite that uses query planner of H2 internally. However, you can use it in H2 too. Note that this setting actually affects only the current session and does not require any privileges (online documentation is not correct), so you can

[h2] Re: java -cp h2*.jar org.h2.tools.Recover -> Exception in thread "main" java.nio.BufferUnderflowException

2019-03-23 Thread Evgenij Ryazanov
Unfortunately, in this case you need to insert some try-catch blocks into sources to skip broken pages. Perhaps you can comment out invocations of MVStoreTool.dump() and MVStoreTool.info() in Recover.process() first. They aren't required. -- You received this message because you are

[h2] Re: java -cp h2*.jar org.h2.tools.Recover -> Exception in thread "main" java.nio.BufferUnderflowException

2019-03-23 Thread Evgenij Ryazanov
Hello. You can build H2 from its current sources: https://github.com/h2database/h2database Building instructions are here: https://h2database.com/html/build.html#building You need a jar target. There was a change since the last release that may help you. -- You received this message because

<    1   2   3   4   5   6   >