Re: ADO and Locking
John <John@xxxxxxxxxxxxxxxxxxxxxxxxx>'s wild thoughts were
released on Fri, 29 Sep 2006 12:03:02 -0700 bearing the
following fruit:
I use VB6/ADO/SQL Server 2000.
I have a table (MachineConfig) that controls two machines. When the machine
(ID = 1) starts, it will create it's own configuration data into the table,
then "select * from MachineConfig where MachineID = 1" into a ADO recordset,
then process and update the configuration through the recordset. At the same
time, the other machine needs to start and do the same thing. However, it
cannot start at all.
Is the table locked when one machine starts? The recordset is just a subset
of the table, why is the whole table locked? Is there any way I can lock just
a row?
You need to give the table an index so that the database can
perform row level locking.
If there are no indexes then you pretty much give it no
option other than lock the whole table.
Jan Hyde (VB MVP)
--
Polarize: What penguins see with (Hershy)
.
Relevant Pages
- Re: Disconnected ado
... Or is it just something about writing and do you mean with recordset ... draw in a large quantity of real time data from various external feeds (Tib ... > data being provided to them using ADO .Net recordset classes. ... a read lock on the table and a write lock at row level for ... (microsoft.public.dotnet.framework.adonet) - Re: ADO Slow transaction
... Now I get a nice trappable lock error during the 1 sec it takes to update - actually more than 1 sec if on a slow network connection. ... Check new RecSet is the same as the original RecSet ... Update the record set as required and invoke Update. ... Open new recordset for writing ... (microsoft.public.vb.general.discussion) - Re: MaxLocksPerFile problem
... >> This is the first time I've ever run into this. ... >> generates a file lock and each file lock takes up 2 bytes. ... >> would involve closing and re-opening the recordset? ... Resume WorkAround 'Redirect to re-open recordset ... (microsoft.public.access.modulesdaovba) - Re: ADO Slow transaction
... Now I get a nice trappable lock error during the 1 sec it takes to update - actually more than 1 sec if on a slow network connection. ... Check new RecSet is the same as the original RecSet ... Update the record set as required and invoke Update. ... Open new recordset for writing ... (microsoft.public.vb.general.discussion) - Re: Is this a good idea?
... I mean, if I do a LOCK TABLES, how do I know MySQL is going to do a row lock and not a table lock? ... If you need row level locking, you need to use a database that supports row level locking. ... Other databases (postgres, Oracle, etc.) have more explicit row level locking support ... (comp.lang.php) |
|