table-lock

SQL Server ALTER field NOT NULL takes forever

I want to alter a field from a table which has about 4 million records. I ensured that all of this fields values are NOT NULL and want to ALTER this field to NOT NULL ALTER TABLE dbo.MyTable ALTER COLUMN myColumn int NOT NULL ... seems to take forever to do this update. Any ways to speed it up or am I stuck just doing it overnight dur...

Hibernate - apply locks to parent tables in polymorphic queries

I have two objects: public class ParentObject { // some basic bean info } public class ChildObject extends ParentObject { // more bean info } Each of these tables corresponds to a differnet table in a database. I am using Hibernate to query the ChildObject, which will in turn populate the parent objects values. I have defined my m...

mysql locking question

Hi. 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 app that demonstrates this process. pointers/thoughts/thanks.. -tom ...

Rails running multiple delayed_job - lock tables

Hey. I use delayed_job for background processing. I have 8 CPU server, MySQL and I start 7 delayed_job processes RAILS_ENV=production script/delayed_job -n 7 start Q1: I'm wondering is it possible that 2 or more delayed_job processes start processing the same process (the same record-row in the database delayed_jobs). I checked the c...

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 an error in your SQL syntax; Any thoughts? ...

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 being posted (the table I wish to lock is the key on their transaction that interferes with my...

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 ...