couldn't perform di edit because ...
Posted in 1999
Topics: Server Administration, Security, Permissions & Auditing, Versions, Editions & End-of-Life
Hi all, I'm new to Informix and I have this silly problem. I developed an application using Delphi 3 as front-end and IDS 7.3 as database server. The interface is connected to the database server via Infromix Client 2.8 The database server runs on an NT Workstation machine. Each user logs into the server with the same login and same password, but when a user tries to edit or delete something inserted by another user I always get the error COULDN'T PERFORM THE EDIT BECAUSE ANOTHER USER CHANGED THE RECORD. I tried to grant dba privileges to public, but nothing appened. Can anybody help me?. Thanks in advance Marco mailto:dellegi@kernex.it
How are you accessing the data on Informix. Are you using TTable or TQuery. How long do you keep the object (TTable or TQuery) opened? I'd recommend that you either lock the record(s) that is/are being viewed by the first user, or issue an explicit UPDATE statement when updating the data rather than updating the TTable or TQuery object. Thanks, Imran. Marco wrote in message <36B02778.143C96E2@kernex.it>... >Hi all, >I'm new to Informix and I have this silly problem. >I developed an application using Delphi 3 as front-end and IDS 7.3 as >database server. >The interface is connected to the database server via Infromix Client >2.8 >The database server runs on an NT Workstation machine. >Each user logs into the server with the same login and same password, >but when a user tries to edit or delete something inserted by another >user I always get the error >COULDN'T PERFORM THE EDIT BECAUSE ANOTHER USER CHANGED THE RECORD. >I tried to grant dba privileges to public, but nothing appened. >Can anybody help me?. > >Thanks in advance >Marco > > >mailto:dellegi@kernex.it >
Marco: This is just an educated GUESS, but it sounds like Delphi (via whatever mechanism) implements its own locking model which in this case sounds like optimistic locking, i.e., it isn't Informix that's returning the error, but the intermediary engine between Delphi and Informix (in the old days this would have been, say, Borland's ODAPI). It SOUNDS LIKE that when you change a given record in Delphi, via, say, some sort of browsable spreadsheet-like screen object, Delphi makes a copy of the before image of the record when you get into edit mode on the record. You make your changes, then when you commit the record (maybe by moving off of it?), it reads same the record from disk, compares it with the copy it made when you started to edit it, and if there's a difference, it says "oh, while you were editing, some sneaky user modified the data", and gives you the error. The only way to proceed is to refresh your view of the data. Perhaps the solution is to acquire a good-old-fashioned pessimistic lock as suggested by Goutam? HTH, --Jeff Marco wrote: > Hi all, > I'm new to Informix and I have this silly problem. > I developed an application using Delphi 3 as front-end and IDS 7.3 as > database server. > The interface is connected to the database server via Infromix Client > 2.8 > The database server runs on an NT Workstation machine. > Each user logs into the server with the same login and same password, > but when a user tries to edit or delete something inserted by another > user I always get the error > COULDN'T PERFORM THE EDIT BECAUSE ANOTHER USER CHANGED THE RECORD. > I tried to grant dba privileges to public, but nothing appened. > Can anybody help me?. > > Thanks in advance > Marco > > mailto:dellegi@kernex.it
Hi Marco! The problem is in a way how Delphi identify key for the records in the live queries. It just simply use something like "UPDATE table1 SET field1 = value1 WHERE field1 = oldvalue1 AND ..... AND fieldN = oldvalueN". Better use TUpdateSQL to identify records for update either by ROWID either by Primary Key. -- Ivan Lyakhovenko, project manager, xTech Ltd. Novosibirsk, Russia. mailto:van@xTech.ru http://www.xTech.ru Marco ''''' ' ''''''''' <36B02778.143C96E2@kernex.it> ... >Hi all, >I'm new to Informix and I have this silly problem. >I developed an application using Delphi 3 as front-end and IDS 7.3 as >database server. >The interface is connected to the database server via Infromix Client >2.8 >The database server runs on an NT Workstation machine. >Each user logs into the server with the same login and same password, >but when a user tries to edit or delete something inserted by another >user I always get the error >COULDN'T PERFORM THE EDIT BECAUSE ANOTHER USER CHANGED THE RECORD. >I tried to grant dba privileges to public, but nothing appened. >Can anybody help me?. > >Thanks in advance >Marco > > >mailto:dellegi@kernex.it >