Unix Technical Forum

Named user lock facility in IDS?

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 05:04 PM
David N. Heydon
 
Posts: n/a
Default Named user lock facility in IDS?

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 05:04 PM
Madison Pruet
 
Posts: n/a
Default Re: Named user lock facility in IDS?

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:43 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com