Questions tagged [table-lock]

42 questions
0
votes
1 answer

Lock a SQL server Table for a given time and check if it is locked

I want to lock a table for a given amount of time in SQL Server . I am using C# at code level. How can I achieve it, I also need to verify that the table is locked or not. I do not have much knowledge of locking tables in SQL Server. I want to…
Madhur Maurya
  • 1,016
  • 4
  • 19
  • 42
0
votes
1 answer

Is it possible to use PDO lastInsertId() when the table was previously locked?

This question is again important to me. Does anyone have a solution? $conn = new PDO('mysql:dbname=test;host=127.0.0.1', 'root', '********'); $conn->exec('CREATE TABLE testIncrement ' . '(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name…
Nikola F
  • 21
  • 2
0
votes
1 answer

Explicit table locking to disable DELETES?

Using Oracle 11gR2: We already have a process that cleans up particular tables by deleting records from them that are past a specified retention date (based on the comparison between the timestamp from when the record finished processing and the…
0
votes
1 answer

Adding table lock manually to specified table in SQL Server

I want to INSERT into one tables but prevent INSERTING to another one. It is possible to LOCK for example table a for INSERTING, INSERT to table b and then UNLOCK table a? TABLOCK can lock only the table I am INSERTING in. Thanks Martin Pilch
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
0
votes
2 answers

Persistent SQL Table lock from C#

I'm trying to create a persistent SQL (SQL Server 2005) lock on a table level. I'm not updating/querying the specified table, but I need to prevent a third party application from updating the locked table as a means to prevent transactions from…
Chris
  • 439
  • 7
  • 15
0
votes
2 answers

Mysql syntax help

Query: select t1.col1 from table1 t1 inner join with (nolock) table2 t2 on t1.col2 = t2.col1 Am trying to use nolock option for optimized query in mySQL db, but for some reason the above query does not work and the error i receive is You have…
Karthick
  • 17
  • 1
0
votes
1 answer

SQL Connection/Command proper management (to avoid table LOCKS)?

I'm setting up a connection factory for a .NET project, and I'd like to ask what is the best way for it. I have an issue with the previous Log class not being able to write the logs properly because of table LOCKS (or so they say), so I'm tasked…
Danicco
  • 1,573
  • 2
  • 23
  • 49
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

Locking MySQL table at web server level

Suppose I have a web app (using Django on the server side) and I would like one of the users (admin-like user "A") to be able to load a certain view (webpage) where she can modify the database tables which will prevent other users to accessing the…
jazzblue
  • 2,411
  • 4
  • 38
  • 63
0
votes
2 answers

mysql locking question

Investigating/researching mysql/myisam locking. trying to find a good example of how to set the lock in appA, and determine/detect the tbl lock in appB. searching google, not seeing much, so i must be missing something. i'm going to be writing a php…
tom smith
  • 1,035
  • 7
  • 23
  • 39
0
votes
1 answer

cron or TRIGGER on continually INSERTing table1 or CURSOR (or alternative) to UPDATE 1m row InnoDB table2 without locking?

Does anyone have any recommendations how to implement this? table1 will constantly be INSERTed into. This necessitates that every row on table2 be UPDATEd upon each table1 INSERT. Also, an algorithm that I don't know if MySQL would be best…
user1382306
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 2
3