Mark A wrote:
"Serge Rielau" <sr*****@ca.ibm.com> wrote in message
news:37*************@individual.net...
The READ ONLY column properties on typed views was introduced in order
to create subviews with expressions for columns which are natively
updatable in the parent.
The easiest way to make a view READ ONLY is this:
CREATE VIEW v1 AS SEELCT ....FROM ...., TABLE(VALUES (1)) AS A(a);
The optimizer will throw the VALUES(1) out, so it should be harmless.
Cheers
Serge
Serge Rielau
Are you suggesting that no share locks are taken on the real table?
No. I'm suggesting that this makes the view READ ONLY.
Operating on a hunch here w.r.t. OP's question.
There are various clients (and apps, and users, ...) which are rather
sloppy when it comes to defining a cursor as read only.
So any cursor opened on an updatable query will hold a U lock on the row
it positions even if the isolation level is UR.
This trick will make away with the problem. So UR will take no locks.
Cheers
Serge
PS: I learned that some JDBC drivers by default even presume cursors to
be scrollable... now there is a way to wreck performance.
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab