mysql - Auto-COmmit of DDL -


i read "create table" , "drop table" statements auto-commit. trying understand behaviour below scenario:

conn.setautocommit(false); stmt = conn.createstatement("create table ...");  conn.commit(); 

in above case, setting autocommit false have impact on create table auto-commiting. if conn.setautocommit(false) override ddl auto-commit property, whats entire point, because default new connection in auto-commit mode.

i believe except mysql , older versions of oracle, major rdbms allow ddl rollback. questions concerns if in mysql ddl rollback not allowed, point of setting auto-commit of connection false ddl operations?

i appreciate opinion in clarifying doubts.

executing ddl statement causes "implicit commit". statement has executed.

the scenario give doesn't make sense me, createstatement method doesn't take string argument, it?

we typically see

stmt = conn.createstatement(); stmt.execute("create table ... "); 

if execute ddl statement, causes implicit commit, if had run commit; statement before ran ddl statement.

but don't take word it, try yourself, , consult appropriate section of mysql reference manual whichever version of mysql running.

reference: https://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -