cancel
Showing results for 
Search instead for 
Did you mean: 

File Locking in XI-

Former Member
0 Kudos

Hi all,

I need to implement file locking technology for all of my interfcaes.Could anyone explain me the basics and detailed procdure for this?

Thanks

Rajesh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

As of now in XI file adapters there is no file locking concept implemented. You can use a temporary file and then once the file is fully written, file adapter will rename it as per the file name schema provided.

Also Refer

where they talk about the OSS Note 821267

Thanks

Former Member
0 Kudos

try this....

/people/michal.krawczyk2/blog/2005/05/25/xi-how-to-add-authorizations-to-repository-objects

Message was edited by:

Raghavesh Reddy

santhosh_kumarv
Active Contributor
0 Kudos

Hi Rajesh,

Look into the Note 821267 (3 question).

Unfortunately, the J2EE 1.3 technology the File Adapter is built upon does not support file locking. This limitation affects the File Adapter's operation. Depending on whether the JRE implementation for the operating system under which the adapter runs uses mandatory file locking or advisory file locking, opening a file that is currently being written to by another process will fail or not.

If opening the file fails, no problem exists and the adapter will try to open the file each poll interval until it succeeds.

However, if opening the file is not prevented by the operating system, the adapter starts to process the file although it is still being modified. Since XI 3.0 SP11 / PI 7.0 there is a parameter named "Msecs to Wait Before Modification Check" in the advanced settings of the File Sender channel configuration to work around this issue. This setting causes the File Adapter to wait a certain time after reading, but before sending a file to the Adapter

Engine. If the file has been modified (which is basically determined by comparing the size of the read data with the current file size of the input file) after the configured interval has elapsed, the adapter aborts the processing of the file and tries to process the file again after the retry interval has elapsed.

If this option is not available for the settings you would like to use, the following algorithm (to be implemented in your application) may be used to ensure that the File Adapter only processes completely written files:

- Create the file using an extension, which does not get processed by the File Adapter, e.g., ".tmp"

- Write the file content

- Rename the file to its final name, so the File Adapter will notice its existence and pick it up

Source: SAP Note

Regards

San