This is a discussion on Named user lock facility in IDS? within the Informix forums, part of the Database Server Software category; --> I wonder if someone could comment on if Informix IDS has a named user locking facility. I'm looking for ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I wonder if someone could comment on if Informix IDS has a named user locking facility. I'm looking for the ability to lock things on the database server without being restricted by tables/rows/transactions etc. I would like to use this for all sorts of things within applications where controlled access is required to a given resource, i.e. access to a file on a filesystem,, I was looking at Oracle recently and noticed it includes a facility like this in a package called DBMS_LOCK. See http://download-uk.oracle.com/docs/c...258/d_lock.htm for further info. Any thoughts on how to achieve something similar with Informix IDS would be most welcome! Cheers, David |
| ||||
| David N. Heydon wrote: > I wonder if someone could comment on if Informix IDS has a named user > locking facility. I'm looking for the ability to lock things on the database > server without being restricted by tables/rows/transactions etc. I would > like to use this for all sorts of things within applications where > controlled access is required to a given resource, i.e. access to a file on > a filesystem,, > > I was looking at Oracle recently and noticed it includes a facility like > this in a package called DBMS_LOCK. See > http://download-uk.oracle.com/docs/c...258/d_lock.htm > for further info. > > Any thoughts on how to achieve something similar with Informix IDS would be > most welcome! > > Cheers, > > David > > Create a table call is something like "lock_table". Make it "lock mode row". create table lock_table { lock_name varchar(255) primary key, hold_lock integer } lock mode row; To 'allocate a lock', simply insert a row into the lock_table. To set the lock "update lock_table set hold_lock = hold_lock + 1 where lock_name = "my lock"; To release the lock - commit. |