Access Lock and DDL Statement

Database

Access Lock and DDL Statement

One of our database deployments failed because an ALTER statement was blocked by a SELECT statement against a view with a locking row for access modifier. It is important to note that the view referenced the table being altered one to one and the SELECT statement started before the ALTER. Here is a model of what happened:

 

 

CREATE TABLE foo_table (a integer, b integer) PRIMARY INDEX(a) ;
REPLACE VIEW foo_view AS LOCKING ROW FOR ACCESS SELECT a, b FROM foo_table;
--First sql statement 
SELECT a,b FROM foo_view;
--Alter statement
ALTER TABLE foo_table  ADD c INTEGER;

 

 

1 REPLY
Senior Apprentice

Re: Access Lock and DDL Statement

See my other reply...

Ward Analytics Ltd - information in motion
www: http://www.ward-analytics.com