× 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 Tue, 2004-09-07 at 16:43, Richard Rothe wrote:
> I don't have the luxury of using embedded SQL since we don't have SQL
> DevKit.  So, I must use native RPG I/O in my encapsulation endeavors.
> 
> What should I do to prevent record-locking ?  Should I code every
> operation no-update (N) and read the record for update when I need to ?
> Or, do I need to not worry about record locks and be more concerned
> about whether the record was updated by another user since the last read
> ?

Richard,

You could have multiple files, a logical for reading, and one for
updating, writing, and deleting.  Then you just chain to the update
logical right before the update or delete.  You could also do a ton of
open-chain-close operations, but I'm pretty sure you'd take a big
performance hit, so I wouldn't recommend it.

If you wanted to verify that the record was the same as when you
initially read it, you could save the original return values into a DS,
chain again before the update, and then compare the two DS's.  In fact,
this may be a handy way to prevent unnecessary updates as well (where
none of the fields have changed).  We have an application (written when
I was still in middle school) that updates any time you hit enter on the
maintenance screen.  As such, the change dates and users are not very
useful.

BTW, I think the SQL DevKit is only about $800.  It might be worth
looking into.

Joel
http://www.rpgnext.com


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-2025 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.