Re: MS Access 2007 update write conflict problem & resolution

From: "justin(at)magwerks(dot)com" <justin(at)magwerks(dot)com>
To: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: MS Access 2007 update write conflict problem & resolution
Date: 2010-03-19 20:47:52
Message-ID: 20475234006960@mail.magwerks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support pgsql-general


When connected to ODBC source Access ignores locking steps. I don't think that's the problem.

If memory serves, when Access is building the UPDATE command automatically the WHERE clause includes every single column being updated when the old values, something like this

Update set col =145, col2 = 'jjj', col4 = '12/01/10 10:05:5.032' where
col =oldvalue1 and col2 = 'jjj' and col4 = '12/01/10 10:05:5.03'

this means it will not find the record returning the error you see.

to over come this very annoying feature you have to manually specify the update commands and the key to use.

---- Message from mailto:richard(dot)broersma(at)gmail(dot)com Richard Broersma richard(dot)broersma(at)gmail(dot)com at 03-19-2010 01:12:35 PM ------

On Fri, Mar 19, 2010 at 11:12 AM, justin(at)magwerks(dot)com
justin(at)magwerks(dot)com wrote:

The bigger problem is using time stamps to find the record for updating

Timestamps will not be unique as more than 1 record can have the same value

I suggest changing the updating method to use a unique key.

MS-Access achieves optimistic locking by listing all of the columns in
a table in the WHERE clause of the UPDATE statement. If ms-access
unable to fully represent the data stored in a postgresql table,
Access will throw back update conflict errors when postgres doesn't
update the record due to the truncated data values. I've also seen
this with null valued boolean fields.

Part of the solution would be configure the ODBC driver to use
PostgreSQL's xmin for optimistic locking. Of-course this doesn't fix
MS-Accesses inability to handle the ranges of many of PG data-types.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

All legitimate Magwerks Corporation quotations are sent in a .PDF file attachment with a unique ID number generated by our proprietary quotation system. Quotations received via any other form of communication will not be honored.

CONFIDENTIALITY NOTICE: This e-mail, including attachments, may contain legally privileged, confidential or other information proprietary to Magwerks Corporation and is intended solely for the use of the individual to whom it addresses. If the reader of this e-mail is not the intended recipient or authorized agent, the reader is hereby notified that any unauthorized viewing, dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and destroy all occurrences of this e-mail immediately.
Thank you.

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Josh Berkus 2010-03-19 21:08:30 Re: Request: get rid of annoyance with new SQL window
Previous Message Richard Broersma 2010-03-19 20:12:35 Re: [GENERAL] MS Access 2007 update write conflict problem & resolution

Browse pgsql-general by date

  From Date Subject
Next Message zhong ming wu 2010-03-20 00:02:07 returns 0 row from plpgsql function
Previous Message Peter Eisentraut 2010-03-19 20:38:51 Call for translations