Re: Committed read
Posted in 2000
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I would be more concerned with my ability to lock exclusively the table
<br>in question and not focus on the isolation level which is a transaction
<br>oriented issue.
<br><i>ALTER TABLE table_name </i>LOCK MODE (ROW); ...
will cause
<br>Informix to attempt to place an exclusive lock on the table for the
dur-
<br>ation of the DDL event. As long as there are existing lock(s) on the
table,
<br>shared or otherwise, this attempt will fail. You must have exclusive
access
<br>to the table for the period of time the command executes.
<br>The nature of the apps I support is such that I am aften having to
modify
<br>locking on various tables in our databases. Typically with a database
that
<br>is logged, I lock the table in exclusive mode (LOCK TABLE <i>table_name</i>
<br>IN EXCLUSIVE MODE) first and then execute the ALTER TABLE stmt
<br>against it. Keep in mid if the database is logged you must be <i>in-transaction</i>
<br>to do attain the table lock, eg: ...
<p>BEGIN WORK;
<br>LOCK TABLE customer IN EXCLUSIVE MODE;
<br>ALTER TABLE customer LOCK MODE (ROW);
<br>COMMIT WORK;
<p>Ensure you can access the table, ensure you can modify the table, ensure
<br>you can lock the table and then alter the table.
<p>have a nice day.
<br><i></i>
<br>
<br>
<p>Mukund D Shevkar wrote:
<blockquote TYPE=CITE>I am working on stock trading database where there
is a 'quote' table
<br>accessed by multiple web users in commited read islation level. onstat
-k
<br>shows a shared lock for placed. Now I want to alter table and change
the
<br>page level locking of the table to row level. It returns an error
<br>-242 Could not open database table table-name.
<br>What isolation level do I use for alteration to a table when
the table will
<br>have a shared lock?
<br>TIA
<p>Mukund</blockquote>
</html>