Apply locks to a row or a table
Posted in 2000
Topics: Server Administration
Hello !!! I have an Informix Universal Server 9.14 engine, with one database with a lot of tables. I access to these tables trough the DBACCESS utility and/or a web based application. I need to know what commands I have to use to set a lock to a row of a given table or to an entire table, using the DBACCESS. And then I need the commnads to unlock them. Remark: my database has logging mode. Thanks !!! Alejandro Cabrera Obed E-mail: sisdis@tournet.com.ar ICQ#95838645 Bs. As. - Argentina Alejandro Cabrera Obed Responsable Informatico Proyecto PNUD ARG 97/047 http://www.sisdis.gov.ar E-mail: sisdis@tournet.com.ar ICQ#95838645 Tel. 54 11 4331-7344 int. 5527 Bs. As. - Argentina
Hi Alejandro, to lock a table, you may try issueing the command: LOCK TABLE <table name> IN <SHARE/EXCLUSIVE> MODE. to unlock it, UNLOCK TABLE <table name> With regards to row level locking, this is dependent on what lock level your DBA has placed on the table. If the lock level of the table you are concerned is row level, then you can lock a single row, otherwise locking a single row may actually lock more than one row (page level locking). Considering that you indeed have a row level locking, the only way I could think of to lock it is to place that row into a transaction and apply an update on it. If you don't want to change anything and you just want to lock it, then you still issue an update on a field but the new value you set is still equal to its current value. Hope this helps. Happy holidays. Alejandro Cabrera Obed wrote: > Hello !!! > > I have an Informix Universal Server 9.14 engine, with one database with a > lot of tables. > I access to these tables trough the DBACCESS utility and/or a web based > application. > I need to know what commands I have to use to set a lock to a row of a given > table or to an entire table, using the DBACCESS. And then I need the > commnads to unlock them. > Remark: my database has logging mode. > > Thanks !!! > > Alejandro Cabrera Obed > > E-mail: sisdis@tournet.com.ar > ICQ#95838645 > Bs. As. - Argentina > > Alejandro Cabrera Obed > Responsable Informatico > Proyecto PNUD ARG 97/047 > http://www.sisdis.gov.ar > E-mail: sisdis@tournet.com.ar > ICQ#95838645 > Tel. 54 11 4331-7344 int. 5527 > Bs. As. - Argentina