autocommit

vimrc auto-commit w/message prompt

懵懂的女人 提交于 2019-12-14 02:34:04
问题 I use the following command in my vimrc to auto commit on save. I find this very useful. However I do not like that I am stuck with the same commit message every time. autocmd BufWritePost * execute ':silent ! if git rev-parse --git-dir > /dev/null 2>&1 ; then git add % ; git commit -m "Auto-commit: saved %"; fi > /dev/null 2>&1' What I would like is to receive a prompt when saving that allows me to either provide a commit message or press enter and use the "Auto-commit: saved %" as a default

sqlite3 saving changes without commit command in python

岁酱吖の 提交于 2019-12-12 08:06:15
问题 i read somewhere to save data to a sqlite3 database in python you got to call the commit() function on the connection object. i never do this but my database still gets the data saved to it... why? 回答1: Auto-commit definition When auto-commit is on, SQL transactions are: implicitly started by the SQL library (with a BEGIN statement) before data modification statements ( INSERT , UPDATE , DELETE or REPLACE ); explicitly ended by the user (with a COMMIT or ROLLBACK statement). When auto-commit

Mysqli rollback not working

女生的网名这么多〃 提交于 2019-12-11 10:29:30
问题 The Mysqli documentation indicates that if the call autocommit(false) returns true, it was successful in disabling the automatic committing of queries. Still, if I try to rollback the transaction, created like the following code, the information remains deleted. $dbConn= new mysqli($host, $user, $pass, $db) or die('Could not connect'); $dbConn->autcocommit(false); //returns true $dbConn->query($deleteQuery); $dbConn->query($deleteQuery2); $dbConn->rollback(); What could go wrong in this

Execute postgreSQL stored procedure as one transaction

梦想与她 提交于 2019-12-07 09:41:27
问题 I'm using PostgreSQL 9.3 and I have some stored procedures created which contains several statements. I'm calling this stored procedures in a Java application with the help of a prepared statement. Now I've read that each statement inside the stored procedure is executed as a transaction, i.e. one commit after each statement. But what I want is to have the whole stored procedure executed as one transaction, i.e. only one commit. How can I do this? Perhaps deactivating autocommit on the JDBC

MySQL - How to check if START TRANSACTION is active

自作多情 提交于 2019-12-07 01:42:37
问题 I have noticed that START TRANSACTION automatically COMMIT the previous queries. Because of this and the fact that I have several stored procedure called before the end of the whole transaction, I need to check if I am inside a START TRANSACTION or not. Reading the manual I understood that autocommit is set to false inside a START TRANSACTION , but it doesn't seem like this. I have written the following procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `test_transaction`() BEGIN show

Problems with autocommit in sqlite3 module from Python3

我的梦境 提交于 2019-12-06 14:23:33
问题 I'm having trouble turning off the auto-commit mode in a given database connection. According to what I understood from the sqlite3 module documentation, the python code bellow should not raise any AssertionError exception, but it does. The table "nomes" already exists in the database and contains the column "Nome" import sqlite3 _PATH_DB = '/rhome/FNORO/tabelao/sofia.sqlite' # path to database _ISOLATION_LEVEL = "EXCLUSIVE" _TEST_NAME = "TEST1" # delete name from database with sqlite3

Cannot disable autocommit?

て烟熏妆下的殇ゞ 提交于 2019-12-06 10:44:28
问题 I have Ubuntu 12.04 guest VM with a MySQL 5.5.35 instance on it. I cannot seem to bypass / turn off autocommit feature... I wanted to try out some scenarios related to SELECT ... FOR UPDATE; , so I opened two database sessions - one from the MySQL workbench on the VM itself, and another one from mysql CLI, on my Windows host. Whatever I do in either of the two sessions is instantly visible in another. Autocommit or no autocommit set, transaction or no transaction, explicit commit or no

python pymysql set autocommit false fails

我与影子孤独终老i 提交于 2019-12-05 18:41:16
my script reads MYSQL UPDATE queries from a file and then should execute them at once by using autocommit = 0. However, if I remove conn.commit() it still runs one by one, although I have not commited. Where is the error? import pymysql conn = pymysql.connect(host='x', unix_socket='/tmp/mysql.sock',user='x', passwd='x', db='x') fileHandle = open ( 'mysqlout.txt' ) fileList = fileHandle.readlines() fileHandle.close() i = 1 weiter = input("Execute MYSQL file? ") if (weiter == 'y'): cur = conn.cursor() cur.execute('SET autocommit = 0') conn.commit() for fileLine in fileList: #-----each line is an

DBI database handle with AutoCommit set to 0 not returning proper data with SELECT?

拈花ヽ惹草 提交于 2019-12-05 15:41:49
问题 This is a tricky one to explain (and very weird), so bear with me. I will explain the problem, and the fix for it, but I would like to see if anyone can explain why it works the way it works :) I have a web application that uses mod_perl. It uses MySQL database, and I am writing data to a database on regular basis. It is modular, so it also has its own 'database' type of a module, where I handle connection, updates, etc. database::db_connect() subroutine is used to connect to database, and

Execute postgreSQL stored procedure as one transaction

给你一囗甜甜゛ 提交于 2019-12-05 11:58:19
I'm using PostgreSQL 9.3 and I have some stored procedures created which contains several statements. I'm calling this stored procedures in a Java application with the help of a prepared statement. Now I've read that each statement inside the stored procedure is executed as a transaction, i.e. one commit after each statement. But what I want is to have the whole stored procedure executed as one transaction, i.e. only one commit. How can I do this? Perhaps deactivating autocommit on the JDBC level? Well, basically stored procedures are atomic in nature and executed as one transaction. CREATE