How to set autocommit Off

400 views
Skip to first unread message

Pay Liu

unread,
Feb 5, 2012, 10:24:24 PM2/5/12
to google-cloud...@googlegroups.com


I have a db user, john, who don't have SUPER privilege. 

I'd like john have no autocommit when connecting Cloud SQL.

As I know, to cause clients to begin with a default off, need to set the server's "init_connect" system variable.

How can I do? or no support now?

thanks, 
-Pay

Rob Clevenger

unread,
Feb 8, 2012, 5:02:10 PM2/8/12
to google-cloud...@googlegroups.com
Are you using JDBC, or python?  jdbc requires autocommit to be set to true, so you can call setAutoCommit(false) on Connection.

Python's DPAPI driver requires is to be off, and is therefore off by default.

Rob

Pay Liu

unread,
Feb 9, 2012, 7:16:07 AM2/9/12
to google-cloud...@googlegroups.com
Dear Rob, 

thanks for reply.

Yes, I'm using JDBC and I know use setAutoCommit(false) to begin a transaction in session scope of Connection. 

But using a SQL User account without authority for auto-commit, can easily force programmer to use commit function to manage transaction.


Rob Clevenger

unread,
Feb 9, 2012, 9:11:35 AM2/9/12
to google-cloud...@googlegroups.com
Hi Pay,

We don't support setting init_connect.

Rob

Pay Liu

unread,
Feb 9, 2012, 9:25:37 AM2/9/12
to google-cloud...@googlegroups.com
Got it, Thanks, Rob.
Reply all
Reply to author
Forward
0 new messages