All Questions
Tagged with mysql transactions
2,133
questions
0
votes
0
answers
32
views
Query is not fetching the latest data from MySQL while using FOR UPDATE clauses
I have a table which locks rows as per accountId and a lock status column having values 0 and 1.
CREATE TABLE lock (
id INT(11),
accountId INT(11),
isLocked TINYINT(2),
);
The requirement is ...
0
votes
1
answer
37
views
Rollback Transaction in Mysql Query
DELIMITER ;;
CREATE DEFINER=root@localhost PROCEDURE ExecuteDataFill(IN p_internalCompanyId INT)
BEGIN
DECLARE u_cursor CURSOR FOR
SELECT name, address, area, pincode, city, state, ...
0
votes
0
answers
28
views
Handling InnoDB Behavior for Non-repeatable Reads with Auxiliary Indexes
Suppose there is a table t with columns id (primary key) and name, where name has an auxiliary index. The table contains three rows: 1 green, 2 red, and 3 black.
Assume I open transaction A and ...
0
votes
0
answers
57
views
MySQL 8.0 upgrade/ spike in synch/mutex/innodb/trx_sys_mutex causes application outage
We upgrade mysql from 5.7 to 8.0 on AWS aurora
Problem we are facing is frequent outage of an application.
we observed that there is spike for synch/mutex/innodb/trx_sys_mutex
Performance insights
1
vote
0
answers
34
views
On duplicate key check if the other column is the same
I have a table with the following schema:
CREATE TABLE T (
id BIGINT UNSIGNED PRIMARY KEY NOT NULL AUTO_INCREMENT,
key BIGINT UNSIGNED NOT NULL,
val BIGINT UNSIGNED NOT NULL,
);
I need to ...
2
votes
1
answer
110
views
Transaction isolation level for financial transactions
Let's assume we have an application that must transfer funds from account A to account B.
Let's assume that database is MySQL (though I'd appreciant an answer for Postgres too).
Account A balance: 20
...
0
votes
0
answers
37
views
Strange MySQL Deadlock
I have a queue system where the design can be summarized as these tables -
queue
every new item goes to this table, a service keep reading this table to process the data
"log_yyyyMMdd"
...
0
votes
0
answers
31
views
JavaEE scheduled task wait for transaction commit
I have some Tasks which are stored in a database (MySQL). Task basically makes an API call to a remote system, which throws an exception if two Tasks try to execute concurrently.
This is the current ...
1
vote
1
answer
35
views
Fatest query to lock down a snapshot in MySQL for REPEATABLE READ transaction
Per the MySQL documentation, for a transaction with the REPEATABLE READ isolation level:
Consistent reads within the same transaction read the snapshot established by the first read.
I want to ...
0
votes
1
answer
35
views
Running a program on different computers with different users that access a central database simultaneously - VB.NET XAMPP/MySQL
We're creating a VB.NET program that will be used on several computers with one central database that is on XAMPP/MySQL. Here's my question:
User1 who's in computer1 wants to edit a row in table 1 to ...
0
votes
0
answers
47
views
Gap locks using InnoDB
I am facing deadlock issues which I suspect is from gap lock that is issued when my select for update doesn't find a row
Hi everyone.
Currently I am facing a deadlock issue between two inserts into my ...
0
votes
0
answers
21
views
Lock Acquisition Order in MYSQL [duplicate]
I need a clear picture about lock acquisition order when performing certain queries. Below is the example, I tried.
+-------+----------------------------------------------------------------------------...
0
votes
0
answers
20
views
How to add the transaction and rollback for the query in the repository layer for the python api
In my service layer I have one function,
def model_service(data):
inserted_data=model_repository().new_insert_query()
update_data=model_repository().new_update_query(data)
return ...
2
votes
0
answers
72
views
How to correctly set the lock in MySQL?
There are two tables: site (id, name, url), page (id, code, content, path, site_id). The site table has a record with id = 1. The page table is empty.
I'm trying to insert a new record into the Page ...
0
votes
1
answer
145
views
There is no active transaction
I want to call a stored procedure which creates a dynamic view within a transaction in Laravel:
Laravel:
try {
DB::transaction(function() use ($raison_sociale_clean, $coming) {
...