dragonwell-project / dragonwell11

Alibaba Dragonwell11 JDK
https://www.aliyun.com/product/dragonwell
GNU General Public License v2.0
557 stars 113 forks source link

[Bug] transaction autocommit when jdk used in eclipse #27

Open urn1ce opened 4 years ago

urn1ce commented 4 years ago

JDK Version:Alibaba Dragonwell 11.0.8.3 GA Eclipse Version: 2019-06 (4.12.0) when i use jdbc to commit work like this: connection.setAutoCommit(false); ... statement.executeBatch(); System.in.read();//when run here, then i click Terminate Button to simulate tcp disconnection to verify how MySQL autorollback connection.commit();//Something strange happened here,after i clicked the Terminate Button,the code shouldn't do connection.commit(),but it did;the transaction was commited;

i don't know it is jdk's problem or eclipse problem,but i write here.

joeyleeeeeee97 commented 4 years ago

I wonder if you are using windows or mac eclipse jdbc drivers in that case, and also more information about the server could help us. Actually we have an issue template to follow, here is an example: Execution environment

OS and version: Windows server rc 2012 CPU model: x64 Number of CPU cores: 4C Size of physical memory: 8G Inside Linux container? no Linux container name (docker, pouch, etc): no Linux container version: no

urn1ce commented 4 years ago

OS and version:Ubuntu 20.04 kernel 5.4.0-42-generic CPU model:x64 Number of CPU cores:2C,4cores totally Size of physical memory: 2G Inside Linux container? no,just run ubuntu in VMware 14.1.2 Mysql version: 8.0.21 (jdbc version is the same)

other things i make changed : when i simulate tcp disconnection, i modified the server kernel param: tcp_keepalive_time=15 tcp_keepalive_probes=2 tcp_keepalive_intvl=4 to feel the influence in seconds level

i made 2 vm machine,the client is also ubuntu 20.04 cloned from the server,but the client didn't modify the kernel param,and the jdk and eclipse were installed in client ubuntu;. that's all