Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4k views
in Java FTP by (160 points)
We're using edtFTPj/PRO 3.1.2 to transfer files between Unix and z/OS (app running on Unix). Protocol is passive mode FTPS.

To connect, we issue the following calls (client is an instance of SecureFileTransferClient):

        client.setProtocol( Protocol.FTPS_EXPLICIT);
        client.getAdvancedFTPSettings().setRetryCount( 0);
        client.setEventListener( new EventLogger());
        client.setContentType( FTPTransferType.ASCII);
        client.getAdvancedFTPSettings().setConnectMode( FTPConnectMode.PASV);
        
        client.connect();

Immediately afterwards we were issuing the site command:
        client.executeCommand( "site lrecl=9 blksize=27990 recfm=fb");

and then uploading a file.

The problem is that sometimes (not consistently for a single host and across multiple hosts) the uploaded file is not formatted according to the parameters of the site command. The log didn't help; both the site command and the file upload completed successfully. The uploaded file is fairly small. We also tried issuing the site command immediately after the connection was opened as well as immediately before the upload.

I suspect what's happening is the site command and the upload command are sometimes being passed in different connections, causing the upload to save the file in the wrong format, but I can't prove it. The reason I suspect this is that originally we had the site command broken into three calls to executeCommand(). On occasion the second or third command would fail, as if the first command had never been issued. The only reason I can think of for such a failure would be if the commands were executed on different connections/threads.

Can anyone shed light on this? Thanks.

Bob

3 Answers

0 votes
by (162k points)
Do you need multiple connections? First thing to try is to set the maximum pool size to 1 so that no additional connections are created, e.g.

SecureFileTransferClient ftp = new SecureFileTransferClient(1, 1);
0 votes
by (160 points)
Thanks. Setting the pool size to one seems to have fixed the problem, although since it's semi-random I reserve the right to come back again :wink:

Bob
0 votes
by (162k points)
We'll look at adding something so that site commands that are required for every connection will always get executed when the connection is created.

Categories

...