Aaron

It is some time since I updated db2a - have IBM removed the SQL-sync
methods?

On Tue, Mar 20, 2018 at 2:15 PM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:

Otherwise async is a pretty cool feature for other things, but not
everything.

Agreed, use it where it makes sense to fill a programming need.


but when IBM switched to async and stopped updating or supporting the
sync db functions I think it's a mistake.

I think it's important to realize ~why~ this was done.

The sync approach was blocking the event loop from allowing other things to
run. This meant that you would have to do Node.js Clusters to accomplish
concurrency. Moving to asynchronous callbacks allowed the event loop to be
freed up because the DB call was being done in a separate thread in the
same IBM i job. The unfortunate part is we didn't get async/await keywords
at the same because they weren't yet available (Node.js foundation released
v8.x in June 2017 I believe).

We still have the sequential feel with the introduction of async/await,
which is what I believe you're really after. As show in this repo:
https://bitbucket.org/litmis/nodejs-idb-pconnector (notice the 'p' in the
name, which stands for "Promises").



Aaron Bartell
IBM i hosting, starting at $157/month. litmis.com/spaces


On Tue, Mar 20, 2018 at 8:04 AM, Bradley Stone <bvstone@xxxxxxxxx> wrote:

On Mon, Mar 19, 2018 at 7:24 PM, Nathan Andelin <nandelin@xxxxxxxxx>
wrote:


I'm curious too. Particularly if the "batch script" were performing any
DB
I/O. Why would you do that in Node.js?



I'm in the same camp here with async operations for most DB, especially
retrieving data. I hear the argument "but your program can go and do
this
and that while the result set is being retrieved". That's the whole
point.. I need that result set before I can continue on! :)

Updating, inserting and deleting for the most part can be anynch, but
when
IBM switched to async and stopped updating or supporting the sync db
functions I think it's a mistake. Especially if you're doing business
programming.

Otherwise async is a pretty cool feature for other things, but not
everything.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.