Subject | Re: [firebird-support] get_lock / release_lock |
---|---|
Author | Kjell Rilbe |
Post date | 2008-07-31T08:26:32Z |
Doru Constantin wrote:
"document" is in your app. Is it a data item stored in the DB? A BLOB
field? An external file, whose name is stored in the DB?
Do you need pessimistic locking, so that the user can't START editing
without obtaining a lock?
Is this a kind of check-out-and-lock/check-in-and-release feature?
If it's a (BLOB or other) field and optimistic locking is OK, then your
simply need to try the insert or update with the new/modified document,
and if it fails, then you have to catch the exception and handle the
conflict in your app.
If it's more like check-in/check-out with pessimistic locking, then you
need something like what I suggested (or possibly the RDB$GET_CONTEXT
etc which I'm not familiar with).
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
> I have an old app: vfp + odbc + mysql.After reading Helen's reply, I think you need to clarify what a
> I try to replace mysql with minimal change in code.
>
> In this app when a user is add/modify/delete a document the get_lock()
> function is called and if the lock is get then the user can continue
> otherwise don't.
>
> I read about RDB$SET_CONTEXT / RDB$GET_CONTEXT, but "... variables may be
> read and written to and by whom are determined by namespace which they
> belong to.".
>
> I need RDB$SET_CONTEXT / RDB$GET_CONTEXT but in a global context.
"document" is in your app. Is it a data item stored in the DB? A BLOB
field? An external file, whose name is stored in the DB?
Do you need pessimistic locking, so that the user can't START editing
without obtaining a lock?
Is this a kind of check-out-and-lock/check-in-and-release feature?
If it's a (BLOB or other) field and optimistic locking is OK, then your
simply need to try the insert or update with the new/modified document,
and if it fails, then you have to catch the exception and handle the
conflict in your app.
If it's more like check-in/check-out with pessimistic locking, then you
need something like what I suggested (or possibly the RDB$GET_CONTEXT
etc which I'm not familiar with).
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64