Lua: AUTOCOMMIT

mgasperi_work
SQL-Fighter

Hello!

I'm facing troubles when turning AUTOCOMMIT OFF - my Lua script is called via JDBC, they have said that they've turned off AUTOCOMMIT, but still I can see "GlobalTransactionRollback msg: Transaction collision: automatic transaction rollback."

Now my idea was to turn off AUTOCOMMIT in Lua - but how? Does anybody know if this is possible and if so, please let me know how.

query([[SET AUTOCOMMIT OFF]]);

The code above does not work.

Many thanks in advance!

Michael

1 ACCEPTED SOLUTION

exa-Uwe
Moderator
Moderator

Hi Michael,

AUTOCOMMIT settings are done at the client layer - either by the JDBC connection or by your SQL client.

A Lua script is executed at the database layer, therefore it cannot control this setting.

Best regards

Uwe

View solution in original post

3 REPLIES 3

exa-Uwe
Moderator
Moderator

Hi Michael,

AUTOCOMMIT settings are done at the client layer - either by the JDBC connection or by your SQL client.

A Lua script is executed at the database layer, therefore it cannot control this setting.

Best regards

Uwe

View solution in original post

ecoh_dr
Contributor

Hi @mgasperi_work. As far as I know, AUTOCOMMIT is a JDBC driver parameter, so you can't modify it within an estabilished connection.

Moreover, executing the "SET AUTOCOMMIT OFF;" statement in a plain SQL editor throws a syntax error.

You should review the parameters of your connection.

 

Best regards,

Daniele

mgasperi_work
SQL-Fighter

Thanks for your reply:

"SET AUTOCOMMIT OFF;" works with Exaplus (aka command line client tool)