Re: HELP Informix Locks
Posted in 1996
In article <4r0vf3$gdf@cssun.mathcs.emory.edu>, Susik_Lee@United#u#Group .CCMAIL.CompuServe.COM writes > Tolis, > > When I was using share mode lock with page mode lock in table, some > times I run out of locks. I think because that it will count 1 lock > per page, thus if you are updating many rows, you will use more than 1 > lock. > > Anyway, do you know how many row locks can you have in one page. For > example, if I want to update 1000 records in a table, do you know how > may locks I will be using in share mode with page lock? > > We are using On-line 5.x. > > Thank > > Susik > <Snip> >Hi Vil, > >it has to do with the lock mode of your table.If it is page mode it will only >place 1 lock on the table.If it is row mode it will place a lock on every row >even if you issued a lock table .. in share mode before. >If you however issue a lock table in exclusive mode it will place only 1 lock >regardless of the lock mode of the table.I am not sure if this is a >feature or a bug. > >Regards > >Tolis This is a feature, when you update/delete a row in a table it takes an EXCLUSIVE mode on the row/page depending upon on the lock mode of the table. This means no-one else can READ or write to the table. Locking the table in SHARE mode means that no-one else can write to the table but they can READ from the table. When updating you need to take out an exclusive lock so that no-on can read the old version or a partly updated version. When you take a share lock out on a table you stop other people from writing to it whilst you are reading it. -- David Williams