Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two maps calling the same batch file at the same time -

Status
Not open for further replies.

clk430

Programmer
Sep 21, 2005
235
US
What would happen if two separate maps have the same output batch adaptor targeted and the maps are executed at the same exact time? Would the file error with some sort of contention error or do batch sript files run with multiple instances?

I'm guess I'm not sure how DOS batch scripts are accessed and run by Mercator...

This is on 6.7 win2k.
 
If the batch script is thread safe you should be OK. If not there could be a conflict or problem with the result. The DS TX engine calls the OS command interface to execute batch files.

BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Thanks for your reply BocaBurger. How can I determine if the batch scripts is threadsafe?

If it helps, this batch file is executed on the prod server itself and is an FTP put:

REM This script puts files to the DMZ FTP server via SecureFX.
:mainloop
E:\EC\xxxx\xxx.exe /Log "E:\EC\xxxx\xxxFX.log" %1 /S
if not errorlevel 0 goto mainloop
if errorlevel 0 goto success
:success
:end

The reason I am asking is that the maps that call this batch scripts are very closely calling it at the same time. Once in a blue moon, the second map that calls the batch script runs but the batch script does not execute.

It's one of those "once in a blue moon" situtions that are hard to create test cases for!
 
Is xxx.exe application thread safe? Since you seem to have a fixed log file name, there would be contention there too.

You could use an FTP command file and not need SecureFX, but I am not sure what that adds.




BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Good point BocaBurger, the log file is one point of contention. The .exe (sfxcl.exe), well, I am not sure if it is threadsafe or not.
 
OK, question: If Mercator's output is a batch file using the batch adaptor, when does that map consider the transaction a success (on output)? When the batch file completes or when the batch file is just successfully called?

eyetry, are you talking to me? :)
 
When the batch is complete. IE... in most cases I've tried if the batch fails the map will know it.

exceptions have been related to ftp bat files. This may have changed in more recent versions though.
 
So, there are exceptions for the batch file above?

How about this: Within the batch file, there is an executable. So, does the batch file complete when the executable completes? Basically, the map is dependant upon successful completions of the batch file which in turn is dependent on the successful completion of the executable, correct? Yikes.
 
eyetry, are you talking to me? "

Well,usually whoever is listening ;)

Actually, due to contractual arrangments, we use SecureFX for specific client relationships that require SFTP or SSH transfers. We also have SFTP transactions that are setup outside of SecureFX.

Granted I haven't tried hard but, as of today I haven't been able to execute an SFTP via TX unless it's thru a batch file.

So, I was wondering if BocaBurger could tell me if TX can execute an SFTP without executing a non-TX script like a bat file.

 
The batch file could complete before what it has called completes or not, depends on if another command is called. The map completes after a certain time, whether or not the batch completes, unless you use the -poll option to force the map to wait (basically increasing the time out). You can use secure FTP if you purchase the Security Option.
It also depends on the level of security. FTP supports a command file. You can call the OS' FTP client via batch or shell script, and it will process the FTP command file.
This is used when the FTP process does not follow the RFC.
What you do is go to a command prompt and type FTP and then every subsequent step, one by one. Copy that transaction and save to a text file. Then call the OS FTP in a batch file, with the command file as an option on the FTP command line.
So clients have a map that updates the command file as needed, before the batch adapter call.


BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top