Questions tagged [table-locking]

104 questions
0
votes
1 answer

How do I make sure I'm not updating the same record from multiple processes? Do I need table locks?

I'm working on a project using a MySQL database as the back-end (accessed from PHP). Sometimes, I select a row, do some operations on it, and then update the record in the database. I am worried that another user could have initiated a similar…
SwammiM
  • 463
  • 6
  • 15
0
votes
2 answers

MultiThreading in Java causing Table lock

I am doing insertion into a Oracle table using batchUpdate. Five different parallel threads are invoking batchUpdate method to insert into a single table. Table is of Global Temporary Table type. Program execution is not completing, its getting…
0
votes
3 answers

SELECT...FOR UPDATE with prepared statement is not working

I am trying to create a fb-like-button function(not facebook api). There are two buttons on my website: like and dislike. Database will save how many likes and dislike in total. Here is the db table: id |post_id |like_count 40 | 20 | …
0
votes
1 answer

MySQL Write Lock Priority

I'm curious about write locks with MySQL and how they are prioritized with eachother. Specifically, I'm wondering if "low priority write" locks have lower priority than "normal" write locks, or if they are equal. The only documentation I can find…
Adam Marshall
  • 6,369
  • 1
  • 29
  • 45
0
votes
1 answer

Data locking prevents query from running - MySQL InnoDB

We need to run a script every 24h that calculates sums & avarages of data from 1 big log table and updates the data in the Main_Table (Innodb) that has many select/update queries all the time (about 1 per second) I ran a test query on a local DB…
SiteAppDev
  • 141
  • 2
  • 8
0
votes
1 answer

How to know about DB health from "Table_locks_immediate" and "Table_locks_waited" in mysql

How to know the health of the mysql db by seeing the "Table_locks_immediate" and "Table_locks_waited" values from DB status. I want to know if the ratio between "Table_locks_immediate" and "Table_locks_waited" is of any importance.
H4XOR
  • 134
  • 1
  • 1
  • 6
0
votes
1 answer

Lock an entire single table but still allow to access other tables in the same session on MySQL

Is it possible to lock a single table on MySQL for a session and still be able to read and write on other unlocked tables on the same session that locked that table while the table is still locked?
razenha
  • 7,660
  • 6
  • 37
  • 53
0
votes
1 answer

how do I reliably insert into a table then retrieve the autonumber in a multi user system

Suppose I run an insert statement like this: $sql = "insert into tbl_features (feature_class, feature_name, description) values (?, ?, ?)"; $q = $pdo_conn->prepare($sql); $q->execute(array($_GET['new_feature_class'],…
Kelly Larsen
  • 963
  • 1
  • 14
  • 30
0
votes
1 answer

Should I use table locks or transactions?

I have 2 tables, one called user, stores users, and one called process that stores the list of active processes updating users. What I want to do is be able to select 50 out-of-date users, lock them by inserting a record in the process table with…
Fabien Warniez
  • 2,731
  • 1
  • 21
  • 30
0
votes
1 answer

MySQL get next unique value without auto increment

I have an MySQL database (InnoDB) that I'm developing for tracking Work Orders at my organization. There are multiple 'sites', and each site has work order numbers starting at 100. WorkorderID SiteID SiteWorkorderNum 1 1 …
dangel
  • 7,238
  • 7
  • 48
  • 74
0
votes
1 answer

MS Access Locks Tables in SQL Server?

I've been using SQL Server for 2+ years but I am new to MS Access. I have just started to look at MS Access as a potential front-end/portal to access SQL Server and I was talking with a colleague who said I should be wary of the potential for MS…
PingPing
  • 899
  • 6
  • 15
  • 28
-1
votes
1 answer

Is mixing transactions and table locks unrealistic in MySQL 5.7?

I am looking to mix table locks and transactions in an API. I have selected MySQL 5.7 as the storage engine, though I am not particularly committed to any specific RDBMS. I am interested in seeing whether my current design is suitable for MySQL…
halfer
  • 19,824
  • 17
  • 99
  • 186
-1
votes
2 answers

Prevent race condition and lock tables in hotel booking system PHP/MySQL

I am building a hotel style reservation system and I am loosing the way. I've got stuck at the exactly reservation moment when to add the reservation and I am concerned about come situations. My flow is really easy, it lets multiple user to go…
Marco C
  • 45
  • 1
  • 8
-2
votes
1 answer

Database-neutral table locking library for PHP

I have a scenario in which I think I need to lock a table against all activity (reads and writes). I am using Propel 1.6.x and intend to write a small extra library to handle the locking. My use case is a version table that has a primary key of (id,…
halfer
  • 19,824
  • 17
  • 99
  • 186
1 2 3 4 5 6
7