Board index » delphi » Locking problem with BDE to Informix

Locking problem with BDE to Informix

When I want to change one particular record with a Delphi program (or with
the SQL Explorer), The Borland BDE constantly gives the error 'couldn't
perform the edit because another user changed the record'.
I use Delphi4 with the BDE 5.1. I also tested with BDE 5.01.

When I try to change the record with an SQL statement with dbaccess of with
the SQL Explorer (update tregdet set kostenplts='6F' where regnr=72 and
kostenplts='7F' ) then I can change the record, so the record isn't locked!

I put the table with Datapump to another machine (from Informix 7.22C1,
Online on Sun Solaris to Informix 7.3 on Linux Suse), that particular record
still can't be changed. I'm sure the record isn't locked (I am the only
person on this machine).

I changed the lock level of this table from page locking to row locking, but
that isn't a solution.

The structure of the table is:
--  Table infebema.tregdet
CREATE TABLE infebema.tregdet (
  regnr INTEGER,
  eindtijd DATETIME  YEAR TO FRACTION(3),
  pctijd DATETIME  YEAR TO FRACTION(3),
  werkduur FLOAT,
  kostenplts CHAR(3),
  prestacode CHAR(3),
  pcnaam CHAR(10),
  controle CHAR(1),
  prwerkduur FLOAT,
  prkostenplts CHAR(3),
  prprestacode CHAR(3),
  gewijzigddoor CHAR(10)
)  EXTENT SIZE 16 NEXT SIZE 16  LOCK MODE ROW

--  Index infebema.regnrtijd
CREATE  INDEX infebema.regnrtijd ON infebema.tregdet (
  regnr ASC,
  eindtijd ASC)

Who can help me?

 

Re:Locking problem with BDE to Informix


I finally solved the problem.

The problem is the updatemode property of my TQuery in Delphi.
When updatemode=UpdateWhereAll, then the BDE tries to find the record by
sending a SLQ statement with the value of every field (you can see this with
the borland sql monitor).
But the BDE has sometimes problems with float fields: it sometimes puts more
or less digits after the decimal point than the original value. So the value
in the sql statement doesn't match with the value in Informix. And then
Informix says the record has changed!

When I put the updatemode of my TQuery on 'UpdateKeyOnly', my problem is
solved. Then the BDE only puts the values of the index fields in the SQL
statement to find the record.

Philippe

Other Threads