 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
kostyl
Joined: 06 Nov 2012 Posts: 1 Country: Ukraine |
|
24x7 Scheduler version 3.4.24 DatabaseConnect issue |
|
Hello.
I have following issue with DatabaseConnectEx statement. When i use it in my .jal file everything works fine, job successfully connects to db and can receive data from DatabaseRetrieve statement etc.
But when i use DatabaseConnectEx in created by myself script in Script Library - i have connection to db only in created script. In that script connection succeeds, i can receive data from DatabaseRetrieve etc, but when script finishes and i return to jal file - connection to db disappears! DatabaseRetrieve throws an error that there is no connection to database.
Is it possible to keep connection during the whole .jal file running, including scripts from script library? Can you tell me what i did not do or what i did wrong?
Thanks a lot!
|
|
Tue Nov 06, 2012 1:31 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
The scope of both DatabaseConnect and DatabaseConnectEx is limited to the current script only. DatabaseDisconnect is executed implicitly when the script completes and the connection goes out of scope. If you need a connection both in the JAL job script and user-defined JAL statement , you would need to open 2 separate connections, one from each script.
Just a tip, an alternative to using reusable user-defined statements is using external reusable JAL files that are "included" into the main script using @SCRIPT tag.
|
|
Tue Nov 06, 2012 1:37 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|