transaction-isolation

postgresql trigger: disable auto commit and set isolation level

蓝咒 提交于 2019-12-02 05:32:33
问题 i'm writing a trigger on database INSTEAD OF INSERT ON a table, that made some operation, then insert data into different related tables. Now i need to disable autocommit and set a different isolation level inside trigger, how can i do? 回答1: PostgreSQL doesn't have a setting that disables autocommit except for embedded SQL. If you try to set autocommit off in, say, PSQL, you'll see something like this error. sandbox=# set autocommit=off; ERROR: SET AUTOCOMMIT TO OFF is no longer supported

MySQL Workbench session does not see updates to the database

一世执手 提交于 2019-11-30 20:22:43
I have MySQL Workbench (community-6.2.3) installed in a Ubuntu system using .deb. Workbench session does not seem to see updates (DML) to the database done by other sessions (applications/command line client). A new session is able to see correct status of the database at its start but non of the changes that happen afterwards is visible to it. It seems workbench session does sync up with db after a commit in workbench. I'm getting Error Code: 1412. Table definition has changed, please retry transaction when I try to query a table that I've created from a different session. Non workbench

Minimum transaction isolation level to avoid “Lost Updates”

烂漫一生 提交于 2019-11-30 11:30:35
With SQL Server's transaction isolation levels, you can avoid certain unwanted concurrency issues, like dirty reads and so forth. The one I'm interested in right now is lost updates - the fact two transactions can overwrite one another's updates without anyone noticing it. I see and hear conflicting statements as to which isolation level at a minimum I have to choose to avoid this. Kalen Delaney in her "SQL Server Internals" book says (Chapter 10 - Transactions and Concurrency - Page 592): In Read Uncommitted isolation, all the behaviors described previously, except lost updates , are possible

MySQL Workbench session does not see updates to the database

谁说我不能喝 提交于 2019-11-30 05:09:00
问题 I have MySQL Workbench (community-6.2.3) installed in a Ubuntu system using .deb. Workbench session does not seem to see updates (DML) to the database done by other sessions (applications/command line client). A new session is able to see correct status of the database at its start but non of the changes that happen afterwards is visible to it. It seems workbench session does sync up with db after a commit in workbench. I'm getting Error Code: 1412. Table definition has changed, please retry

Minimum transaction isolation level to avoid “Lost Updates”

夙愿已清 提交于 2019-11-29 16:42:39
问题 With SQL Server's transaction isolation levels, you can avoid certain unwanted concurrency issues, like dirty reads and so forth. The one I'm interested in right now is lost updates - the fact two transactions can overwrite one another's updates without anyone noticing it. I see and hear conflicting statements as to which isolation level at a minimum I have to choose to avoid this. Kalen Delaney in her "SQL Server Internals" book says (Chapter 10 - Transactions and Concurrency - Page 592): In

What is the difference between Non-Repeatable Read and Phantom Read?

风流意气都作罢 提交于 2019-11-28 14:59:13
What is the difference between non-repeatable read and phantom read? I have read the Isolation (database systems) article from Wikipedia , but I have a few doubts. In the below example, what will happen: the non-repeatable read and phantom read ? Transaction A SELECT ID, USERNAME, accountno, amount FROM USERS WHERE ID=1 OUTPUT: 1----MIKE------29019892---------5000 Transaction B UPDATE USERS SET amount=amount+5000 where ID=1 AND accountno=29019892; COMMIT; Transaction A SELECT ID, USERNAME, accountno, amount FROM USERS WHERE ID=1 Another doubt is, in the above example, which isolation level

Does MySQL/InnoDB implement true serializable isolation?

女生的网名这么多〃 提交于 2019-11-28 08:20:13
It is not entirely clear from MySQL documentation whether the InnoDB engine implements true serializable isolation 1 or snapshot isolation , which is often confusingly called "serializable" too. Which one is it? If MySQL InnoDB doesn't, are there any completely free, production-quality RDBMS which do? 1 where "true serializable isolation" means the absence of not only read anomalies as per the SQL standard, but also the write skew anomaly, explained in further detail here . regilero UPDATE: See comments, this seems to be fixed in MySQL 5.5 , with these examples we still have a table lock and

What is the difference between Non-Repeatable Read and Phantom Read?

≯℡__Kan透↙ 提交于 2019-11-27 08:57:05
问题 What is the difference between non-repeatable read and phantom read? I have read the Isolation (database systems) article from Wikipedia, but I have a few doubts. In the below example, what will happen: the non-repeatable read and phantom read ? Transaction A SELECT ID, USERNAME, accountno, amount FROM USERS WHERE ID=1 OUTPUT: 1----MIKE------29019892---------5000 Transaction B UPDATE USERS SET amount=amount+5000 where ID=1 AND accountno=29019892; COMMIT; Transaction A SELECT ID, USERNAME,

NOLOCK vs. Transaction Isolation Level

前提是你 提交于 2019-11-27 02:36:39
问题 What's the difference between using "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED" and NOLOCK? Is one better than the other? 回答1: They're the same thing, just scoped differently. NOLOCK is placed on a per table basis and SET Transaction... can be placed as a block. 回答2: NOLOCK is a query hint and as such only applies to the specifc table within the query in which it is specified. Setting the transaction isolation level applies to all code executed hence forth within the current connection

Does MySQL/InnoDB implement true serializable isolation?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 02:09:19
问题 It is not entirely clear from MySQL documentation whether the InnoDB engine implements true serializable isolation 1 or snapshot isolation, which is often confusingly called "serializable" too. Which one is it? If MySQL InnoDB doesn't, are there any completely free, production-quality RDBMS which do? 1 where "true serializable isolation" means the absence of not only read anomalies as per the SQL standard, but also the write skew anomaly, explained in further detail here. 回答1: UPDATE: See