Re: A question regarding table locks

Re: A question regarding table locks

 

  





This will still lose the table lock right after you do it in the command
line.

Use an application or the command center if you want to lock and hold a
table.

Dan Callahan IT Specialist
603-472-4121 t/l 525-4121
[Email address protected]
[Email address protected]




"mike"
<db2udbdba-ezmlms
hield-x79847901.x To
[Email Address Removed] "LazyDBA Discussion"
a.com> <[Email address protected]
cc
08/27/2004 04:38
PM Subject
Re: A question regarding table
locks














Tony,

It's been a while since I tested this, but I believe you can simply run the
following command to turn off autocommit for your current connection prior
to running the lock table command:

update command options using c off;

You also need to run this command (when autocommit is the default) when you
attempt to activate not logged initially for a table (see following
command):

alter table your_table_name_goes_here activate not logged initially;

Mike




"Anthony Schmidt " <db2udbdba-ezmlmshield-x5073952.[Email address
protected]
on 08/27/2004 03:27:01 PM

To: "LazyDBA Discussion" <[Email address protected]
cc:

Subject: A question regarding table locks


I'm pretty new to DB2 (just recently passed the 700 exam - WUL) but have
some questions regarding explicit table locking.

I have about 20 years experience as an R:Base DBA and developer and in
that environment it is possible to lock a table to prevent all other users
from having access and then unlocking the table when done. R:Base is
always in an Autocommit "On" state, but that doesn't prohibit one from
locking and unlocking tables.

In DB2 it seems that the default Autocommit "On" seems to mean that as
soon as you have run the "Lock Table tablename in exclusive mode" the
locked tables automatically are unlocked.

I have already done an extensive amount of VB6 DB2 programming relying on
Autocommit being "On" so I'd hate to have to rewrite all my code to
explicitly Commit every transaction.

So, in this environment, is there any way to lock and unlock tables the
way I used to in R:Base?

Tony

==============================
Anthony Schmidt
President
The Computery Ltd.
One East Main Street
Bay Shore, NY 11706

http://www.computeryltd.com


---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html






---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



DB2 & UDB email list listserv db2-l LazyDBA home page