× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Thu, 2008-09-11 at 10:45 -0500, Joe Pluta wrote:
Walden H. Leverich wrote:
Listening to a concurrently podcast this morning I had an interesting
thought, how do you handle the case where the row didn't exist when you
chained for it, but is written by another process before you insert it?

You get an error on the write. It's an application design issue -
usually the chain then write isn't done to try to avoid collisions, but
rather to attempt to aggregate multiple records, usually on history
files. While it's possible that two processes could choose to use that
exact millisecond to attempt to write the same record, in practice it's
either vanishingly rare (user maintenance programs) or non-existent
(batch updates).

Well, I wrote a program that never manifested the problem in my
testing.

Boss and programmer went to customer site for installation and training.
Boss stood in the middle of a room full of clerks sitting at green
screens. Boss led the clerks through a transaction, culminating with
"and now you press Enter". Programmer experienced a sudden urge to skip
the country.

Cheers,
Terry.

That's not to say that such things can't happen. If your design is such
that collisions are possible, then you test the %write for a error. If
you want to avoid the chance of an error, then you use a semaphore.
Lock a data area before you begin the chain/update./write process. But
the overhead there is high - I'd stick with checking the write.

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.