# No commit and query statements

**URL:** <https://forums.percona.com/t/no-commit-and-query-statements/1334>\
**Category:** Other MySQL® Questions\
**Created:** [January 24, 2010, 7:38am UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334 "2010-01-24T07:38:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [January 24, 2010, 7:38am UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334/1 "2010-01-24T07:38:32Z")

</div>

Dear All,  
I have a problem here where first my application will do a select statement then immediately it will run begin and commit statement. I have attached my log file too. The problem now is that if you notice for all the Id such 76,78,80,82, 84 and 86 you have proper begin and commit. I dont understand why for 88 there is a begin statement but no other statement like commit. Is something very suprising because if there is problem with my application then all should fail but I am puzzled why is it not committed.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [January 24, 2010, 10:03am UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334/2 "2010-01-24T10:03:38Z")

</div>

Are you using InnoDB tables?

Is there an uncommitted transaction in SHOW INNODB STATUS?

---

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [January 24, 2010, 11:43am UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334/3 "2010-01-24T11:43:18Z")

</div>

Dear Xaprb,  
Yes I am using all innodb tables.Attached is my file for the innodb engine status. I am dont see any uncommited transaction. Actually what this status gives you in depth about what is happening to my db is it ?

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [January 24, 2010, 2:43pm UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334/4 "2010-01-24T14:43:48Z")

</div>

It is possible that you have AUTOCOMMIT set, so BEGIN and COMMIT are useless anyway.

---

<div class="post-metadata">

**Author:** ![newtomysql](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@newtomysql](https://forums.percona.com/u/newtomysql)\
**Post date:** [February 3, 2010, 10:18am UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334/5 "2010-02-03T10:18:41Z")

</div>

Dear Xaprb,  
I have done this settings init\_connect=‘set autocommit=0’ in my my.ini file. But when I run this query select &#64;&#64;autocommit; it still shows the answer as 1. Why is this happening? Thank you.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [February 3, 2010, 11:07am UTC](https://forums.percona.com/t/no-commit-and-query-statements/1334/6 "2010-02-03T11:07:09Z")

</div>

I can’t answer that. You need to troubleshoot. Start by learning about global and session variables in the MySQL manual, and check the global value. If that’s not the problem, then also check what your mysql client is doing. (Is it command-line, sqlyog, phpmysqladmin, etc? Check what it does.) Look at SELECT CONNECTION\_ID() and then look at what queries that session has executed in the log.
