apache / apache/jmeter

Hardcoded enableAutoCommitOnReturn for dataSource cause failed test suite for some DBs

Open
#5,211 0 comments 0 reactions 0 assignees View on GitHub
os: macOS P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Dmitry Sherstobitov** ([Bug 64012](https://bz.apache.org/bugzilla//show_bug.cgi?id=64012&redirect=false)):
Currently confirmed for Derby DB:

1. Create 2 JDBC Connections: first with autoCommit=true, other with autoCommit=false
2. Create 2 JDBC Samples with any statements (create table in example jmx file. change user_define_classpath property in the example)
3. While executing this test suite - exception occurs:

java.sql.SQLException: Cannot create PoolableConnectionFactory (Cannot close a connection while a transaction is still active.)

Commenting following line of code solves this issue:
org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java:232
dataSource.setEnableAutoCommitOnReturn(false);

(This code was introduced in 3.3 version)

This behavior is hardcoded and there is no way no change this inside Jmeter.

Created attachment [noauto.jmx](https://apache.github.io/jmeter-bugzilla-attachments/12/64012/36920/noauto.jmx): Example JMX
noauto.jmx

````xml




false
false



/PATH_TO/derbyclient.jar



auto
0
10000
60000
true
DEFAULT
true
5000

jdbc:derby://localhost:1527/seconddb
org.apache.derby.jdbc.ClientDriver





noauto
0
10000
60000
false
DEFAULT
true
5000

jdbc:derby://localhost:1527/seconddb
org.apache.derby.jdbc.ClientDriver





continue

false
1

1
1
1576528279000
1576528279000
false





auto
Update Statement
CREATE TABLE Persons (
PersonID int,
LastName varchar(255)
)





Store as String



noauto
Update Statement
CREATE TABLE Persons2 (
PersonID int,
LastName varchar(255)
)





Store as String



false

saveConfig


true
true
true
true
true
false
true
true
false
false
true
false
false
false
true
false
false
false
true
0
true
true
true
true
true








true


````

Severity: normal
OS: Mac OS X 10.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.