Is there any way to know whether the TN database is running using the built in services?
The reason is that if the database is down for some reason wm.tn.doc:recognize service returns the correct Document Type.
I guess it must be loading the document types into memory.
I don’t see anything in the webMethods Trading Networks Programmer’s Reference that fits the bill but the service wm.tn:ping may do the trick. It seems to return information on the running TN, but throws an exception when run with my TN DB (SQLServer) is unavailable. Wrapping this service in your own service which does a try-catch should do the trick.
Do bear in mind you will obviously be using an undocumented service which may change/disappear in later releases.
Regards
Danie
Hello,
Best way to check this will be to use
wm.tn.profile:getHostProfile
or
wm.tn.profile:getUserProfileSummary
with the refresh option set to true. This will ensure the server is running, then call the recognize and submit services.
-Rajesh
You can use wm.tn:ping
If you want TN status from the command line, you could use something similar to this bash shell snippet:
########################################
cd to TN bin directory, since application requires a relative path
cd $IS_SERVER_DIR/packages/WmTN/bin/
Execute the query. This tests TN, Merant, and the backend DB
RET=./tnquery.sh -sql "select * from tab" 2>&1 | grep ACTIVITYLOG
If all went well, the return code of the grep should be 0
if [ $? != 0 ]; then
echo “DB connection check exited with wrong status”
# Netsaint requires critical exit codes to be ‘2’
exit 2
else
echo “DB connection OK”
exit 0
fi
;;
########################################
I’m not getting a numeric value for either pass/fail. Where are you getting the ACTIVITYLOG from - it doesn’t show up as ouptut of the tnquery.sh. Thanks.