You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2017/07/07 06:58:11 UTC

[Bug 61259] New: When set the JDBC auto commit false, the transaction behavior is different with JMeter 2.13 and rollback STMT for each sample.

https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

            Bug ID: 61259
           Summary: When set the JDBC auto commit false, the transaction
                    behavior is different with JMeter 2.13 and rollback
                    STMT for each sample.
           Product: JMeter
           Version: 3.2
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: liu_xp2003@sina.com
  Target Milestone: ---

When I want to test JDBC with transaction and disable auto commit in JDBC
Connection Configuration panel, Each JDBC sampler will be rollback.
This behavior is different with JMeter 2.13+excalibur package and the multiple
JDBC sampler transaction couldn't be tested on latest JMeter version.

JDBC Test Sampler
1. select * from testplan where CreatorId = 10001;
2. select count(1) from testplan;
3. commit

JMeter 2.13+excalibur
Wireshark.info from JDBC client side:
Statement [truncated]: /* mysql-connector-java-5.1.40 ( Revision:
402933ef52cad9aa82624e80acbea46e3a701ce6 ) */SELECT 
@@session.auto_increment_increment AS auto_increment_increment,
@@character_set_client AS character_set_client, @@charac
Statement: SET NAMES utf8
Statement: SET character_set_results = NULL
Statement: SET autocommit=0
Statement: select * from testplan where CreatorId = 10001;
Statement: select count(1) from testplan;
Statement: commit
Statement: rollback
Command: Quit (1)


JMeter 3.2+commons-dbcp2
Wireshark.info from JDBC client side:
Statement [truncated]: /* mysql-connector-java-5.1.40 ( Revision:
402933ef52cad9aa82624e80acbea46e3a701ce6 ) */SELECT 
@@session.auto_increment_increment AS auto_increment_increment,
@@character_set_client AS character_set_client, @@charac
Statement: SET NAMES utf8
Statement: SET character_set_results = NULL
Statement: SET autocommit=0
Statement: select * from testplan where CreatorId = 10001;
Statement: rollback
Statement: SET autocommit=1
Statement: SET autocommit=0
Statement: select count(1) from testplan;
Statement: rollback
Statement: SET autocommit=1
Statement: SET autocommit=0
Statement: commit
Statement: rollback
Statement: SET autocommit=1
Command: Quit (1)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a rollback statement happens each time a Request is executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Sat Jul 22 12:55:58 2017
New Revision: 1802688

URL: http://svn.apache.org/viewvc?rev=1802688&view=rev
Log:
Bug 61259 - JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a
rollback statement happens each time a Request is executed
Bugzilla Id: 61259

Modified:
   
jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
    jmeter/trunk/xdocs/changes.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a rollback statement happens each time a Request is executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Liu XP <li...@sina.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from Liu XP <li...@sina.com> ---
Yes. I have verified it and it need to be fixed with the additional setting.
dataSource.setEnableAutoCommitOnReturn(false);

You can try to test with following three JDBC Sampler with current fix
soluction.

1. Prepare some records into AAAA table and truncate table BBBB.
2. Do following SQL with 3 JDBC Sampler in one thread.
insert into BBBB (select *  from AAAA)
select Name from BBBB
Query Type with Rollback

3. And then check the BBBB table at last.
If transaction worked normally, the BBBB table should be empty.But,you will
find the table BBBB is not empty.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a rollback statement happens each time a Request is executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |NEEDINFO

--- Comment #3 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to Liu XP from comment #2)
> To make different JDBC Sampler committed in one transaction, we also need
> the following code after fixed line position.
> dataSource.setEnableAutoCommitOnReturn(false);

I don't think this is not needed , did you try setting Auto Commit to false in
JDBC Connection Configuration ?

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a rollback statement happens each time a Request is executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
            Summary|When set the JDBC auto      |JDBC Request : since JMeter
                   |commit false, the           |3.0, when JDBC auto-commit
                   |transaction behavior is     |is false, a rollback
                   |different with JMeter 2.13  |statement happens each time
                   |and rollback STMT for each  |a Request is executed
                   |sample.                     |

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] When set the JDBC auto commit false, the transaction behavior is different with JMeter 2.13 and rollback STMT for each sample.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Liu XP <li...@sina.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a rollback statement happens each time a Request is executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Hardware|PC                          |All
            Version|3.2                         |3.0
         Resolution|---                         |FIXED

--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Author: pmouawad
Date: Sun Jul 16 14:48:48 2017
New Revision: 1802065

URL: http://svn.apache.org/viewvc?rev=1802065&view=rev
Log:
Bug 61259 - JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a
rollback statement happens each time a Request is executed
Bugzilla Id: 61259

Modified:
   
jmeter/trunk/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java
    jmeter/trunk/xdocs/changes.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 61259] JDBC Request : since JMeter 3.0, when JDBC auto-commit is false, a rollback statement happens each time a Request is executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61259

Liu XP <li...@sina.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Liu XP <li...@sina.com> ---
To make different JDBC Sampler committed in one transaction, we also need the
following code after fixed line position.
dataSource.setEnableAutoCommitOnReturn(false);

-- 
You are receiving this mail because:
You are the assignee for the bug.