Record lock?

mmartinic

Member²
Hello,

"LockingMode=lmCheckImmediate" property is very usefull for multi-user environment.

But, we need the same for BDE applications.
Is it possible to make this settings permanent for Oracle 8.1.7? If yes, how?
I've spend all day searching for this SQL command, with no success.

It is urgent, and our client is waiting for this patch, because one application hangs
on UPDATE execution and it is lock problem,
I'm sure.

Thanx,
Mickey
 
This is not an Oracle setting. Explicit locking in Oracle is done by defining a cursor with a FOR UPDATE clause, and this is what DOA is probably generating under the hood (that's why for updates it needs the rowid - otherwise it couldn't build the right where clause).
The BDE does something similar, but gives you fewer options as to the different sequences of checking and locking.
I can't determine what your exact problem is, but perhaps you can work around your situation by taking control of the locking yourself. This somewhat fragile though, since locks obtained through FOR UPDATE cursors are dropped on commit/rollback. This means a SQLPASSTHRU MODE such as SHARED AUTOCOMMIT is a no-no.
Hope this helps somewhat.

------------------
Frans
 
Thanks anyway for your help.

Well, the problem is that we have Delphi application which is using i.e. PROJECTDET table. While client using this application, some records are locked, of course when you open some projects - but not for editing, only for displaying infos from project.

On other side, we have small admin application for updating some fields inside PROJECTDET table. This application reading
project details from extern source and have to send all changes to PROJECTDET table, project by project (INSERT or UPDATE - it depends of project existence).
On first locked record (opened project) it will hang - UPDATE waiting for releasing the lock on this record. And we have no feedback - no error messages, no exceptions.
The application just wait for finishing of UPDATE.

For this purpose I've made small test applications and I have the same problem
(BDE or DOA connection with Oracle).
I.e. if you have in first application DBGrid which is in Edit mode on one record, the second application will wait for UPDATE of this record until you've done COMMIT in first application.

But we need to update this record anyway,
and first application have to display message
like "Record is changed by another user" if it's necessary.

With DOA this can be done if we set LockedMode of OracleDataSet, which providing data for DBGrid, to "lmCheckImmediate". Then the second application will never hang. In any other case, UPDATE will wait maybe forever.

How we can solve the same problem with BDE connection?

Mickey
 
Luckily I found DOA before I needed to delve too deeply in the BDE and the standard TDataSet implementations, so my BDE-skills are almost nonexistent, but here are some possibilities:
a) You're not using TTable with RequestLive set to true are you? This is a major no-no.
b) From the Borland help: "The BDE always attempts to provide an updateable, or
 
Back
Top