cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using 'callback' form of 'connect', JavaScript External Environment

0 Kudos
4,728

I'm encountering a problem using the 'callback' form of 'connect' in the JavaScript External Environment.

The problem is that the callback code doesn't seem to be executed. If I use the synchronous version of 'connect', things work as expected.

I have greated a github gist at (https://gist.github.com/twilkinson/00748d66bef5fff91852) that illustrates the problem.

There are 2 files:

  1. First copy testA.js to C:\\Temp\\testA.js.
  2. Then using ISQL, connect to the 'SQL Anywhere 17 Demo' database and execute testA.sql.

You can see the output in *C:\\Temp\\tests.log".

All that shows in tests.log are the lines

start of test1A
end of test1A
where I would expect to also see the first 10 lines of the Customers table.

It is acting as if the script is terminated without waiting for the asynchronous code to complete. If I run similar code under nodejs directly, it behaves as I would expect with the first 10 lines of the Customer table showing up in the output file.

This occurs with the latest SA17 Developer Edition under both Windows and Linux.

Suggestions?

Thanks,

Accepted Solutions (0)

Answers (0)