trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.42k stars 3k forks source link

Java.DatabaseMetaData.supportsTransactions() is true but java.sql.Connection.setAutoCommit(false) does not work #22205

Open prrvchr opened 5 months ago

prrvchr commented 5 months ago

Hi all,

I am trying to integrate the Trino JDBC driver into the jdbcDriverOOo extension which is a JDBC driver for LibreOffice Base.

When Base creates a table this can generate several DDL commands (ie: creation of the table then creation of the primary key).

In order to rollback in the event of an error on a DDL command, it is necessary to ask if the driver supports transactions and if this is the case when switch to autocommit off.

In this specific case of use then Trino generates an exception.

findepi commented 5 months ago

Can you perhaps reproduce the problem / document expected behavior with a standalone Java program using JDBC directly?

prrvchr commented 5 months ago

Hi findepi,

It is difficult for me to produce an archive just for this problem. On the other hand, I can confirm that if the DDL commands for table creation are not in auto-commit mode then this will not succeed.

The latest version of jdbcDriverOOo allows the creation of tables if their names are given in lower case and I had to force auto commit mode to on for this.

On the other hand, since the ResultSetMetaData does not provide the name of the catalog, schema, and table, it is not possible to edit the tables in LibreOffice Base. It's really a shame....