Odette FTP protocol in Sterling B2B Integrator supports session retries for failed sessions, file transmission retries to restart failed file transfers and file transfer resume to resume partial file transfers.
OFTP Session Retry - It is configured in the remote physical partner. It is a comma separated list of numbers that indicate time in seconds after which a session with that particular remote physical partner will be retried if there was a failure due to “End of Session” command ESID 08(Resources not available. The request for connection has been denied due to a resource shortage. The connection attempt should be retried later). For example, a value of "60,60,120" indicates that the first session retry happens 60 seconds after the first session establishment failure, the next session retry happens 60 seconds after the second failure and so forth. At this stage, files have not been picked up yet for transfer and are still in 'SCHEDULED' and unlocked 'U' status i.e the session failure has happened before SFID generation.
NOTE: In CAPI mode, to enable session retry for all ISDN router related failures, set the OFTP.Global.ForceRetryForAll parameter in Odetteftp.properties file to yes. For better performance, it is recommended not to have long durations between session retries in CAPI mode as the ISDN line is blocked for these durations.

OFTP File Transmission Retry - It is configured in the outbound logical partner contract. It indicates the number of retries for file transmissions after which only the file will be marked with 'FAIL' status . Once a session is established and a file is picked up from the OFTP_OBJECT table and the transfer has begun, it moves to 'SCHEDULED' and locked 'L' status on the sender side and 'RECEIVING' and unlocked 'U' status on the receiver side. If the transfer breaks, the file moves to 'RETRY_PENDING' and unlocked 'U' status on the sender side and 'RECEIVE_FAIL' and unlocked 'U' status on the receiver side. The sender could receive a 98 Remote site emergency close down or a 05 Local site emergency close down. The RETRY_COUNT column on the sender side is also incremented by one after every failure to transmit the file . Whenever a new successful session is subsequently established between the two partners, either by next OFTP scheduler run or a manually created session, and the file in 'RETRY_PENDING' and unlocked 'U' status is picked up, it moves to 'RETRY' and locked 'L' status on the sender side and a new entry is created on the receiver side with 'RECEIVING' and unlocked 'U' as the status. If the transfer is successful, the usual file status of SENT_AND_GOT_ERP on the sender side and RECEIVED_AND_EERP_CREATED on the receiver side will be shown. If the transfer fails again, the status will be back to 'RETRY_PENDING' if file transmission retries are still available or 'FAIL' if the retries are exhausted.

Using OFTP Session Retry and OFTP File Transmission Retry together - Session retry happens only when the session establishment has failed and ESID 08(Resources not available...) has been received. It does not happen when a session was successfully established and the subsequent file transfer has failed due to a 98 Remote site emergency close down or a 05 Local site emergency close down, as in this case the session establishment was actually successful and it is the file transfer that has failed
TIP: Care should be taken to choose OFTP scheduler's frequency longer than the summation of PP's session-retry-intervals so that we do not have more than intended sessions open at the same time which could lead to session clogging.
OFTP File Transfer Resume(5242 and upwards) - It is configured in the physical partner contract. To enable the resume function, select the Restart option check box in the Odette FTP Physical Partner Contract page. A failed file transfer is resumed only if both the partners have enabled the resume function. The number of times the system resumes file transmission depends on the value that is set in the File Transmission Retries field in the Odette FTP Logical Partner Contract page. On transfer of every 1-MB data, the SFIDREST column in the OFTP_OBJECT table of the sending and receiving systems is updated with the sent and received bytes. The transfer progress is displayed in the Odette FTP Queue Advanced Search page.
NOTE: To modify the amount of data that is saved in the SFIDREST column, set the value of the max_stream_chunk_size_bytes parameter in the jdbc.properties file to the required value. For example, to save 2-MB data, set max_stream_chunk_size_bytes to 2048000.

When file transmission fails, the transferred bytes and the received bytes are stored in the SFIDREST column of the sending and receiving systems. In the sending system, the status for a failed entry is RETRY_PENDING, and in the receiving system, the status is RECEIVE_FAIL. When transmission is resumed, the sending system updates the status of the failed entry from RETRY_PENDING to RETRY, and sends the count of the transferred bytes to the receiving system in an SFID command. In response, the receiving system sends the count of the received bytes in an SFPA command. File transfer restarts under one of the following scenarios:
- Byte count of the sending and the receiving systems are equal.
- Byte count of the receiving system is less than the byte count of the sending system.
If the byte count of the receiving system is more than the byte count of the sending system, then the session isterminated because of data integrity reasons. After a successful file transfer, the status of the related entries in the OFTP_OBJECT table is changed appropriately.