Hi,
I'm writing a C# program to access/update data in a Ingres database and
would like some help with how to implement locking.
In the past in our 4GL or embedded ESQL C programs, we've always done
pessimistic locking for updates and used sql statements like 'set
lockmode on test_table where level=table,readlock=exclusive'.
With this being a C# Windows program that will be run on various PCs,
which will all be remote from the Ingres server which is Linux, we lose
some control of just telling users to get out of the program if they're
locking another user.
In this C# program I've tried a couple things to have it timeout if it
can't aquire a lock but it just sits and seems to wait forever or until
the other process has freed up their lock on the table.
I tried setting the IngresCommand instance objects CommandTimeout member
to 2 but no luck.
I also tried executing this statement prior to running my update, 'set
lockmode on test_table where level=table,readlock=exclusive,timeout=2'
hoping the timeout=2 would help, but either way it still sits being
blocked by the other user.
Any help I'd appreciate in either getting these timeouts to work, which
I'd prefer, or if there is a new better approach to locking in the C#
world with Ingres.
Thanks,
Kyle
--
kyledarrenhanson
------------------------------------------------------------------------
kyledarrenhanson's Profile:
http://community.actian.com/forum/member.php?userid=394
View this thread:
http://community.actian.com/forum/showthread.php?t=16917