X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 5C4E4474E44 for ; Sat, 1 Mar 2003 17:27:30 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 22634-05 for ; Sat, 1 Mar 2003 17:26:59 -0500 (EST) Received: from iserver.abag.ca.gov (iserver.abag.ca.gov [198.31.87.3]) by postgresql.org (Postfix) with ESMTP id D9617474E42 for ; Sat, 1 Mar 2003 17:26:58 -0500 (EST) Received: from groupwise.abag.ca.gov (groupwise.abag.ca.gov [198.31.87.26]) by iserver.abag.ca.gov (8.12.4/8.12.4) with SMTP id h21MR0o3000806 for ; Sat, 1 Mar 2003 14:27:00 -0800 (PST) Received: from D01-Message_Server by groupwise.abag.ca.gov with Novell_GroupWise; Sat, 01 Mar 2003 14:27:00 -0800 Message-Id: X-Mailer: Novell GroupWise Internet Agent 5.5.6.1 Date: Sat, 01 Mar 2003 14:26:26 -0800 From: "Fred Parkinson" To: , Subject: Re: record locks? same problem Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=_A0FFF2A4.731273F4" X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/1 X-Sequence-Number: 2720 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=_A0FFF2A4.731273F4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Keep your sanity by repeating "help is on the way" If only it were true. However, sanity is not always based on reality (is t= hat good or bad?) I finally solved my 'the record has been changed by another user...' I install an ODBC datasourse through windows control panel. As the last part of the installation a window pops up that says "Please supply any missing information needed to connect" in driver ver 7.02.00.01 there is a button labeled "connection" in driver ver 7.02.00.05 there is a button labeled "page 2" (or was it page= 1 with this option?) this reveals an option "row versioning" check the box to turn row versioning on that did it, no more error. >>> "Henry Alfke" 02/14/03 01:46AM >>> Hello together, i have the same problem with one table "the record has been changed by anot= her user..." with the same configuration as Fred but at another table on postgres it works fine with only one boolean field. i created both tables from an MS Access Database with the Migration Wizard = from pgadmin II i tested the "problem" table with a view from MS Access (with an without th= e boolean fields) with boolean fields in the view i get the error message "the record has bee= n changed by another user..." on an update of a field without the boolean fields it works fine when i use sql statements from VBA, i have to use a type cast like sqls= tring =3D "... where cbool(mybooleanfield) =3D true" as a workaround, this= will work also any ideas, why i have problem with one table ? At least, you all made a great job on postgres, thank you !! postgres is the most productive tool i ever seen, best regards henry -----Urspr=FCngliche Nachricht----- Von: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.or= g]Im Auftrag von Fred Parkinson Gesendet: Donnerstag, 13. Februar 2003 22:05 An: t.matiisen@aprote.ee; pgsql-odbc@postgresql.org Betreff: Re: [ODBC] record locks? Thanks for responding, clearly i should have been more specific in my descr= iption of the problem. The linked table is a table, created in postgres with the CREATE TABLE comm= and. I am trying to update boolean fields through check boxs in Access datesheet= view, and also through bound controls on forms. I can insert a record through the Access datasheet view by typing a value i= nto the key field in the '*' record (the 'add new record' record) After that I can successfully update fields only if i do so before i leave = that record. After that, any other changes I try to make to the data, for example check = a check box to update a boolean field, i get the "the record has been changed by another u= ser..." message and changes are dropped. I can make updates to the table subsequently only if i execute sql commands= with the Access execute function. Since that form of update works, executing a sql query in access, the syste= m is correctly locating records by the key field value. When I ran the odbc driver install i unchecked the 'bool as char' box. I am actually doing no explicit record locking,=20 No one else is locking the record because we are testing a new system in a = very small development community (2 developers) and the other person is not= here! When our postgres/unix administrator returns i will ask him to turn on psq= lodbc logging to see what postgres thinks of attempts to update the fields = through bound Access controls and the Access datasheet view. Thanks for your help with this matter! Fred Parkinson >>> "Tambet Matiisen" 02/07/03 01:11AM >>> Is your linked table actually a view with insert/update/delete rules? Then the update through bound controls will not work in 7.2. 7.3 resolves the issue. Otherwise the problem could be float (or other non-exact) columns in your table. Access remembers old values of record and when updating, it adds them to where condition: UPDATE table SET col1 =3D newvalue WHERE id =3D old_id AND col1 =3D oldvalu= e1 AND col2 =3D oldvalue2; The mentioned error is returned when the update returns 0 modified rows - someone has changed the record and old values are not current any more. This is called optimistic locking. The problem is, that when Access remembers float values, it sometimes rounds them a bit. select 1/3::float, 0.333333333333333, 1/3::float =3D 0.333333333333333; ?column? | ?column? | ?column? -------------------+-------------------+---------- 0.333333333333333 | 0.333333333333333 | f (1 row) So the optimistic locking condition is not true any more, although the record has not changed. You have to switch on psqlodbc logging and see, what query Access executes. Then you have determine, what column is causing the error. Then you could change datatype of the column. Or you could build a view which rounds the value, add insert/update/delete rules to the view and do all database manipulation through view. I have seen this problem before in this list, so maybe someone has better solution. Tambet ----- Original Message ----- From: Fred Parkinson To: pgsql-odbc@postgresql.org Sent: Thursday, February 06, 2003 10:09 PM Subject: [ODBC] record locks? Whenever I edit a postgresql record from a MS Access datasheet view or bound control, it seems to lock the record forever and subsrquent edits result in "The record has been changed by another user blah blah ..." and I can no longer edit that record from the datasheet view or bound control (though I can execute a SQL query to update it). We are using postgresql 7.2 and ODBC driver 7.02.00.01 This persists even if I delete the linked table and relink it, or close and restart Access. Any ideas? Fred Parkinson ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster --=_A0FFF2A4.731273F4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Keep your sanity by repeating "help is on the=20 way"
If only it were true.  However, sanity is not alwa= ys=20 based on reality (is that good or bad?)
 
I finally solved my 'the record has been changed by ano= ther=20 user...'
I install an ODBC datasourse through windows control=20 panel.
As the last part of the installation a window pops up t= hat=20 says
"Please supply any missing information needed to=20 connect"
in driver ver 7.02.00.01 there is a button labeled=20 "connection"
in driver ver 7.02.00.05 there is a button labeled "pag= e 2"=20 (or was it page 1 with this option?)
 
this reveals an option "row versioning"
check the box to turn row versioning on
 
that did it, no more error.


>>> "Henry Alfke" <henry@reetec.de> 02/14/03 01= :46AM=20 >>>
 
Hello=20 together,
 
i have the same proble= m with=20 one table "the record has been changed by another user..." with the same configuration as=20 Fred
but at another table o= n=20 postgres it works fine with only one boolean field.
 
i created both tables = from an=20 MS Access Database with the Migration Wizard from pgadmin II<= /DIV>
 
i tested the "problem"= table=20 with a view from MS Access (with an without the boolean=20 fields)
with boolean fields in= the view=20 i get the error message "the record has been changed by another user..."&nb= sp;=20 on an update of a field
without the boolean fi= elds it=20 works fine
 
when i use sql stateme= nts from=20 VBA, i have to use a type cast  like    sqlstring =3D "= ...=20 where cbool(mybooleanfield) =3D true" as a workaround,  this will work= =20 also
 
any ideas, why i have = problem=20 with one table ?
 
At least, you all made= a great=20 job on postgres, thank you !!
postgres is the most p= roductive=20 tool i ever seen,
 
best=20 regards
 
henry
 
 
 
 
 
-----Urspr=FCngliche Nachricht-----
Von:=20 pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org]<= B>Im=20 Auftrag von Fred Parkinson
Gesendet: Donnerstag, 13. Februa= r=20 2003 22:05
An: t.matiisen@aprote.ee;=20 pgsql-odbc@postgresql.org
Betreff: Re: [ODBC] record=20 locks?

Thanks for responding, clearly i should have been mor= e=20 specific in my description of the problem.
 
The linked table is a table, created in postgres with= the=20 CREATE TABLE command.
I am trying to update boolean fields through check bo= xs in=20 Access datesheet view, and also through bound controls on forms.
 
I can insert a record through the Access datashe= et view=20 by typing a value into the key field in the '*' record
(the 'add new record' record)
After that I can successfully update fields only if i= do so=20 before i leave that record.
After that, any other changes I try to make to the da= ta, for=20 example check a check box to
update a boolean field, i get the "the record has bee= n=20 changed by another user..." message and changes are dropped.
I can make updates to the table subsequently only if = i=20 execute sql commands with the Access execute function.
Since that form of update works, executing a sql quer= y in=20 access, the system is correctly locating records by the key field=20 value.
 
When I ran the odbc driver install i unchecked the 'b= ool as=20 char' box.
 
I am actually doing no explicit record locking,
 
No one else is locking the record because we are testing a new syste= m in=20 a very small development community (2 developers) and the other person is= not=20 here!
 
When our postgres/unix administrator returns  i will ask him to= turn=20 on psqlodbc logging to see what postgres thinks of attempts to update the= =20 fields through bound Access controls and the Access datasheet view.
 
Thanks for your help with this matter!
 
Fred Parkinson

>>> "Tambet Matiisen"=20 <t.matiisen@aprote.ee> 02/07/03 01:11AM >>>
Is your lin= ked=20 table actually a view with insert/update/delete rules? Then
the update= =20 through bound controls will not work in 7.2. 7.3 resolves=20 the
issue.

Otherwise the problem could be float (or other non-e= xact)=20 columns in your
table. Access remembers old values of record and when= =20 updating, it adds them
to where condition:

UPDATE table SET col= 1 =3D=20 newvalue WHERE id =3D old_id AND col1 =3D oldvalue1 AND
col2 =3D=20 oldvalue2;

The mentioned error is returned when the update returns= 0=20 modified rows -
someone has changed the record and old values are not= =20 current any more. This
is called optimistic locking.

The proble= m is,=20 that when Access remembers float values, it sometimes rounds
them a=20 bit.

select 1/3::float, 0.333333333333333, 1/3::float =3D=20 0.333333333333333;

    =20 ?column?      |    =20 ?column?      |=20 ?column?
-------------------+-------------------+----------
0.33333= 3333333333=20 | 0.333333333333333 | f
(1 row)

So the optimistic locking condi= tion=20 is not true any more, although the
record has not changed.

You = have=20 to switch on psqlodbc logging and see, what query Access executes.
The= n you=20 have determine, what column is causing the error. Then you could
chang= e=20 datatype of the column. Or you could build a view which rounds the
val= ue,=20 add insert/update/delete rules to the view and do all database
manipul= ation=20 through view. I have seen this problem before in this list, so
maybe= =20 someone has better solution.

  Tambet

----- Original= =20 Message -----
From: Fred Parkinson
To:=20 pgsql-odbc@postgresql.org
Sent: Thursday, February 06, 2003 10:09=20 PM
Subject: [ODBC] record locks?


Whenever I edit a=20 postgresql  record from a MS Access datasheet view or
bound contr= ol,=20 it seems to lock the record forever and subsrquent edits
result in "Th= e=20 record has been changed by another user blah blah ..." and I
can no lo= nger=20 edit that record from the datasheet view or bound control
(though I ca= n=20 execute a SQL query to update it).

We are using postgresql 7.2 and= ODBC=20 driver 7.02.00.01

This persists even if I delete the linked table = and=20 relink it, or close and
restart Access.

Any ideas?

Fred= =20 Parkinson


---------------------------(end of=20 broadcast)---------------------------
TIP 4: Don't 'kill -9' the=20 postmaster
--=_A0FFF2A4.731273F4--