[CONJ-1090] AutoCommit Error Created: 2023-07-20  Updated: 2023-12-13  Resolved: 2023-12-13

Status: Closed
Project: MariaDB Connector/J
Component/s: JDBC 4.2 compatibility, JDBC compatibility
Affects Version/s: 3.0.10, 3.1.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: stone Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

Sever version:10.6.14-MariaDB
my.conf:
[mariadb]
datadir=/app/mariadb/data
log_error=out.err
server_id=1
character_set_server=utf8mb4
collation_server=utf8mb4_bin
init_connect='SET NAMES utf8mb4'
explicit_defaults_for_timestamp=1
lower_case_table_names=1
default-time-zone='+8:00'
transaction_isolation=READ-COMMITTED
tmp_table_size=64M
interactive_timeout=1800
wait_timeout=1800
max_connections=200
max_allowed_packet=32M
read_rnd_buffer_size=8M
sort_buffer_size=8M
join_buffer_size=8M
innodb_force_primary_key=1
innodb_log_buffer_size=16M
innodb_flush_log_at_trx_commit=1
innodb_sort_buffer_size=64M
innodb_log_file_size=512M
innodb_print_all_deadlocks=1
innodb_buffer_pool_size=2G

[client]
default-character-set=utf8mb4


Attachments: PNG File 83142041-3B09-43e2-8CDB-E154D6FE4E6B.png     Java Source File MariadbJdbcTest.java    
Issue Links:
Relates
relates to MDEV-32875 Unreliable autocommit flag on connect... Closed

 Description   

Looks like something wrong when invoking getAutoCommit method.
getAutoCommit method always return true.
it should be false actually.



 Comments   
Comment by Diego Dupin [ 2023-07-26 ]

hmm, i've tryed to reproduce the problem without success.
using same config file, mariadb server 10.6.14 and connector 3.1.4 as well.
Driver rely on server information for this, so could you share some other informations on what type of server you are using ?

Comment by Diego Dupin [ 2023-07-26 ]

maybe if connected to a database the current DB engine you are using too would help

Comment by stone [ 2023-07-27 ]

The operation system is CentOS 7.9

Database init script:
CREATE SCHEMA test1 DEFAULT CHARACTER SET utf8mb4 collate utf8mb4_bin;
grant all privileges on test1 .* to newsoft@'%' identified by '***';
flush privileges;

The current DB engine: Innodb

AutoCommit method works fine in 2.7.9 strangely.

Comment by stone [ 2023-07-27 ]

When remove 'autocommit=0' in my.cnf, AutoCommit method works fine.

Comment by Diego Dupin [ 2023-07-31 ]

ho, i think i remember having seen something like that server returning wrong autocommit state when setting 'autocommit=0' in server conf file, but i've never been able to reproduced it. I'll check.

Comment by Diego Dupin [ 2023-07-31 ]

btw, as a workaround, could you try explicitly set autocommit option on connection string using 'jdbc:mariadb://host/db?autocommit=true'

Comment by stone [ 2023-08-02 ]

when appending '?autocommit=true' in jdbcUrl, 'getAutoCommit' method work return correctly

Comment by Diego Dupin [ 2023-12-13 ]

closing since server correction MDEV-32875 now correct behavior

Generated at Thu Feb 08 03:20:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.