Connecting to db in Batch mode

asereb

New Member
Hi guys,

We are running a lot of Progress programs as a night processes in batch mode
using -pf file to connect to the database.
Sometime (on Win 2000) server getting Progress error -1432, cannot connect
to the database. This error coming out from -pf file, so progress session in
this case just dies.

Is there any way to catch this error within batch file and restart progress
again?

Thank you for any help,

Alex
 
What you need to do is write a little front end program that dosn't need any database connection (compile it from a progress session without a database connected).

This allows you to run your program even when the database isn't up. You can then attempt to connect to the database with NO-ERROR and if it fails log a problem or loop until you can connect.

Once you are connected run your batch program from within an DO ON STOP UNDO-LEAVE block. You can now trap any progress stop conditions (eg database is disconnected) and log errors or re-connect and re-run your DB batch program.

If you are running the DB batch program a lot you might want to consider running it persistently for more performance.
 
Here's an example of batch file (.BAT) launched every night on a WinNT 4 Server (works also under W2k) :


C:
cd C:\DLCV9\
C:\DLCV9\bin\prowin32.exe -b -pf E:\APPLICATION\Session.pf -p E:\APPLICATION\night_batch.r -Wa -name application.ini




The -b option specify that you are launching the night_batch.r file in BATCH mode.


The E:\APPLICATION\session.pf file look like this :

#------------------------------------------------
# connexion to database

#------------------------------------------------

-d dmy
-T c:\protmpv9
-yy 1920
-cpinternal iso8859-1
-cpstream ibm850
-cpprint ibm850
-cpterm ibm850
-stream ibm850
-numsep 44
-numdec 46


-nb 255

-db progisst
-N TCP
-H 192.168.1.1
-S progv42 # 3000/tcp in 'services' file


The first parameters can be differents considering your regional settings (here it fits for french parameters).

Last point : it's sometimes better when the batch file is launched with the administrator rights.

Hope it helps.
 
Top