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



The main issue I have with this approach (as I have done it before except
with PHP to a backend Unibasic program) is that polling takes up precious
CPU cycles, and if it is a user interactive app that means you need to be
polling every half a second or so. Get 50 users on the same app and you are
wasting a lot of CPU cycles.

Thoughts?

Aaron Bartell
http://mowyourlawn.com


On Mon, Jun 16, 2008 at 6:43 AM, Larry Ducie <larry_ducie@xxxxxxxxxxx>
wrote:


There is, of course, another alternative:

Write the data out to an xml streamfile and have the java app poll the
directory for new files.

The advantages are:

1) The xml file is structured and easily human-readable.
2) If the java app is not running you can see the files not yet processed.
You can deliberately halt the java app, and the files will just pile up.
3) The directory can be local or remote. Also, your java app can be
anywhere on your network.
4) If a failure occurs in your java app and the xml is moved your "errors"
directory you can drag-n-drop the xml back into the active directory once
all is working again. Try doing that easily using a direct socket call -
where do you put the data when a failure occurs? Try re-filling your DTAQ as
easily as moving your files from one directory to another.
5) You data is extensible - no DTAQ size restrictions, or byte[] with
predefined sizes in your java.

The beauty of using xml streamfiles is also borne out when you see the
abundant tools out there to work with them. It is the pre-eminant data
container.

The beauty of using streamfiles and polling directories is the fact that
each document is considered a unit-of-work and the directory it resides in
determines the work to be done. The sockets/communications side of things is
controlled by the APIs used to read/write move/delete the files. They are
provided by the implementation and you don't need to worry about it (beyond
the normal housekeeping a good application designer should always have).

Just a thought.

Cheers

Larry Ducie

_________________________________________________________________
Be part of history. Take part in Australia's first e-mail archive with
Email Australia.
http://emailaustralia.ninemsn.com.au
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.