File Locking in XI-

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

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

Similar Messages

  • File locking with OSX Server & Microsoft Word

    We have a small office LAN based on a Airport Extreme bases station. Periodically Microsoft Word reports a break in connection to the shared folder where we store documents to get disconnected. When that happens and the user reconnects to the share, the user gets the file read-only message for the Word document that was open at the time.
    I have found that in order to clear the read-only flag, I have to restart the server and open the Word file on the server with the ID of the user who was editing the file on the remote computer. Only that seems to clear the file locking that causes the file to be read-only.
    I cannot figure out a less drastic way to release the lock file. I don't see any hidden temp files in the same folder as the document that is locked for editing found by ls -a or in the root direction of the shared folder in the .TemporaryItems/folders.<UID> that seems to be holding the lock.
    I have run chflags nouchg <Word file> from Terminal, but that seems to have no effect either. I also used xattr to see if there were any locks held that way, but I don't see anything that way either.
    File sharing to Macs only, which are configured just to use AFP through OSX Server.
    Does anyone understand how the file locks of Word documents can be released directly with out restarting the server?
    I should add that the underlying problems seems to be WiFi related. The behavior is that the WiFi connection seems to break long enough that the shared volumes disconnects. Outlook also causes a break. This behavior seems to have started with 10.9 and the purchase of new Retina Display MacBook Pros. I turned off AppNap on the Office applications but that is not clearly helpful. I also have been told the problem seems more likely to occur when Word is open in the background and another program like Outlook is in the foreground.
    Any suggestions appreciated.

    Apple write an operating system and also produce file sharing software as part of that to be used as a file server. Apple provide documentation for third-party software developers on how they should write software to work with Apple's software and also give those developers early access to new versions so those third-party developers can test and if needed make adjustments and issue updates to cope with any Apple changes.
    Some third-party developers are good at dealing with this, some are bad, and some totally ignore what Apple does and give the impression they don't care if their product works properly or not. I think we can all judge where Microsoft sits.
    It appears Microsoft have never paid any attention in particular to how Apple expect file-locking to be handled when accessing files on a Mac server. There have been problems for years and years and years with Office. Two other problems I have seen which seem different to yours but probably related are -
    With Office documents it is supposed to be possible for more than one person to edit the same file at the same time, consider it a miracle if this actually works
    With Office in particular Word, there is an auto-save function, unfortunately the way this seems to be implemented it seems that Word creates a new temporary file each time it auto-saves the document and keeps all the previous temporary files open still, this eventually means potentially over a hundred temporary files are open - just for one Word document and you can then hit a limit on the total number of files you are allowed to have open at the same time. At this point further auto-saves fail, and you also encounter great difficulty doing a real full save of the document.
    I do not hold Apple completely blameless over this issue, it is likely their file-locking implementations change too often, and have inadequate documentation, however even considering this a company the size of Microsoft with the amount of sales (and profit) they derive from Office for the Mac has no excuses at all for failing to put the effort in to resolve any such clearly critical problems.
    We could go on and on about other areas where Microsoft don't play by the (software) rules. Even in Windows Office does not obey the standard print dialog rules Microsoft specified themselves!
    Unfortunately not only is Office for Mac upgraded infrequently, but even when new paid for upgrades are released Microsoft have a history of still not fixing bugs. It goes without saying that a mere free update is even less likely to actually fix a bug, typically such free updates only address security issues. The next version of Office is going to be Office for Mac 2014 see http://www.macworld.com/article/2106643/microsoft-will-release-a-new-version-of- office-for-mac-this-year.html
    One area I confidently predict Microsoft not to resolve in Office for Mac 2014 is that fact that Word for Mac still does not support right-to-left languages like Hebrew and Arabic. This is despite the fact that OS X itself has supported this for years and years, and despite the fact other Mac programs support this including the free TextEdit and Pages - both of which can read Word files. Some people may remember that at one point the Israeli Government temporarily banned all Microsoft software over this issue. See http://apple-beta.slashdot.org/story/03/10/15/2215249/israeli-government-suspend s-microsoft-contracts This issue goes back over TEN years!!
    I note that Microsoft has now taken their OfficeForMac blog offline, probably due to the weight of criticisms. I would not say it is due to out-right anti-Microsoft hate, that war ended long ago. We just want products that work. I myself do use Microsoft products, even at home - where they are the best solution, so I use Microsoft Media Center for example. Sadly this is now being neglected by Microsoft.

  • File lock() method problem

    I know this may be a common question, but can someone explain why this code:
    import java.io.*;
    import java.nio.channels.*;
    import java.util.*;
    public class TestFileLock
         private static File file;
         private static RandomAccessFile fileRandom;
         private static FileChannel fileChannel;
         private static FileLock fileLock;
         private static String process;
         public static void main(String[] args)
              process = args[0];
              try
                   file = new File("/home/fauxn/work/blast/java/java_blast/test.log");
                   //fileWriter = new FileWriter(file, true);
                   fileRandom = new RandomAccessFile(file, "rw");
                   fileChannel = fileRandom.getChannel();
                   for(int i =0; i < 1000; i++)
                        writeLogFile(process + ": happy days\n");
              catch(Exception exception)
                   System.out.println(exception.getMessage());
                   exception.printStackTrace();
         * Method lockes the logFile and then append the string to the file and unlocks the file.
         * @author Noel Faux.
         * @param s The string to be written to be appended to the file.
         private static void writeLogFile(String s) throws IOException
         System.out.println(process + ": trying to lock the log file");
         fileLock = fileChannel.tryLock();
         while(fileLock == null)
                   System.out.println(s + ": waiting!!!!");
                   fileLock = fileChannel.tryLock();
         System.out.println(s + ": logfile locked");
              fileRandom.seek(fileRandom.length());
         fileRandom.write(s.getBytes());
              fileLock.release();
              System.out.println(s + ": logfile unlocked");
    produces this error:
    Invalid argument
    java.io.IOException: Invalid argument
    at sun.nio.ch.FileChannelImpl.lock0(Native Method)
    at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:528)
    at java.nio.channels.FileChannel.tryLock(FileChannel.java:967)
    at TestFileLock.writeLogFile(TestFileLock.java:43)
    at TestFileLock.main(TestFileLock.java:23)
    on a intel linux box, java 1.4 and this code works fine:
    import java.io.*;
    import java.nio.channels.*;
    import java.util.*;
    public class TestFileLock
         private static File file;
         private static RandomAccessFile fileRandom;
         private static FileChannel fileChannel;
         private static FileLock fileLock;
         private static String process;
         public static void main(String[] args)
              process = args[0];
              try
                   file = new File("/home/fauxn/work/blast/java/java_blast/test.log");
                   //fileWriter = new FileWriter(file, true);
                   fileRandom = new RandomAccessFile(file, "rw");
                   fileChannel = fileRandom.getChannel();
                   for(int i =0; i < 1000; i++)
                        writeLogFile(process + ": happy days\n");
              catch(Exception exception)
                   System.out.println(exception.getMessage());
                   exception.printStackTrace();
         * Method lockes the logFile and then append the string to
    * the file and unlocks the file.
         private static void writeLogFile(String s) throws IOException
         System.out.println(process + ": trying to lock the log file");
         fileLock = fileChannel.tryLock(0, fileRandom.length(), false);
         while(fileLock == null)
                   System.out.println(s + ": waiting!!!!");
                   fileLock = fileChannel.tryLock(0, fileRandom.length(), false);
         System.out.println(s + ": logfile locked");
         fileRandom.seek(fileRandom.length());
         fileRandom.write(s.getBytes());
         fileLock.release();
         System.out.println(s + ": logfile unlocked");
    Any suggestions welcome, or is this a bug????
    Thanks in advance :)

    Its a known bug. The default tryLock() method calls the parametered
    tryLock method as follows
    tryLock(0,Long.MAX_VALUE,false);unfortunately under linux the parameter Long.MAX_VALUE is too big for
    the underlying OS file locking. This causes the IOException to be thrown
    It has been fixed in version 1.4.1 i believe.
    For more info
    http://developer.java.sun.com/developer/bugParade/bugs/4532474.html
    matfud

  • Office 2010 & 2007 - Excel and Access File Locking Out On the Network With Multiple Users

    This is also posted in the Office 2010 - IT Pro General Discussions, but was suggested to repost here, since a definitive answer was not found.
    Hi,
    An issue that's happening is that Excel and Access files are locking on the network. We're currently using Office 2007 and 2010.
    Here are some different scenarios that are happening:
    When opening the file it is locked out by “User X” which is the person that has the file locked out and no one else can open the file.
    When opening the file it is locked out by “User Y” which is NOT the actual person, but is locked out by “User X” and no one else can access the file.
    When opening the file  it is locked out by “…another user” which is generic and no one else can access the file.
    The two more common events are incident 1 and 2 with 3 happening the less common.
    This message will continue until the sessions are closed through computer management on the file server.
    The file server is running Windows Server 2003.
    This does happen on both Windows XP and Windows 7 clients.
    This does happen for users using Office 2007 and Office 2010.
    There are two sets of Office 2010 Users when it comes to patches. Everyone has the most current patches with Office 2010 SP2 while anyone that has Microsoft Project 2010 is using all the current update before Office 2010 SP2.
    All users that are using Office 2007 have all the current patches and service packs.
    Another variable is that we have users that will leave a file open on the network for 3+ days and after a while it will lock the file out.
    Also we have Shadow Copy that runs daily on the system which I'm not for sure if that impacts anything if a file is opening during that time.
    Any ideas on how to mitigate the lock out issues would be appreciated.
    Thanks,
    Binary Process
    Edit November 12, 2013: This issue can occur if and if not another person actually has the file open. If the person doesn't have the file open then there is a hung connection which needs to be disconnected by going to the Computer Management of the File
    server.

    Hi Binary,
    I know that the description of the hotfix does not relate to the issue. The purpose is to install it for upgrading SMB related file.
    A similar issue I encountered before:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b7fcc59b-52d9-4a02-863a-1a529bcb8cb1/temp-doc-etc-files-dont-close-after-a-file-closes-this-causes-locked-files?forum=winserverfiles
    It is resolved by upgrading SMB files so maybe it will help on your case.
    Another hotfix which may related:
    http://support.microsoft.com/kb/983458
    If you have any feedback on our support, please send to [email protected]

  • File locked message when saving a file with Photoshop

    We've been seeing a problem with several users that is hard to reproduce. Every once in a while when they try to save a file in Photoshop on the server they get a dialogue saying 'the file is locked, use Finder info to unlock the file'.
    This file is located on the server and the problem only happens when doing a 'Save', not with a 'Save as'. The server is running 10.5.5 and the clients are 10.4.11. This is happening with Photoshop versions CS1, 2 and 3. It also happend with Illustrator CS3 once.
    We've been experimenting with different scenario's using different ACL's and POSIX settings. Also, when the client reboots their machine the exact same 'Save' actions works again.

    I've been receiving complaints about a similar issue over the past few weeks, except using Quark and Excel. I wonder if it's related to the 10.5.5 update. Are you sure you didn't get the version numbers reversed in your post? We're having the issue with 10.4.11 SERVER and 10.5.5. CLIENTS.
    It's a file locking issue, so you probably won't fix it by changing the ACLs or POSIX permissions. The server thinks a different process still has the file open, so it's preventing you from changing the file. "Save As" works because it creates a new file.
    You can probably eject & reconnect the volume from the client instead of fully rebooting.
    The question is what's keeping the file open. You can run:
    sudo lsof | grep <filename>
    ... in Terminal to see whether a given Mac has the file open. If the server comes back with a response to that command (don't worry what it says - you just want to see if anything comes back), then you know that the file is locked.
    Next, go to each client that could have the file open and run the same command. If none of them have it open, you're probably looking at the same glitch that I've been. The server thinks a file is open but none of the clients do.

  • File locked, intern was using (file sharing). odd?

    An intern, was working on my excel file via file sharing.
    Sometimes, when I just go to open it it says, file locked - Julie working on it.... ok
    But what's odd it she left the office, closed, saved, quit, and I'm still getting this on the file.

    Check the privilages.
    Other resources
    Mac 101: File sharing
    Mac OS X: File can't be moved if locked
    Unable to move, unlock, modify, or copy an item in Mac OS X

  • [Acrobat X Pro] File locks and page counts when printing

    Hi,
    We have two users on Acrobat X Pro Win 7 X32.
    On both systems they have the following issues.
    1) If they were to print only page 1 for example, they can set a page count of 5 copies and it would be fine. If later on they were to print page 10 and they would also like 5 copies, the page count has reverted to the default 1 copy. It doesn't remember the selection of 5 copies from the previous print.
    Is this a bug?
    2) File locks occur on all files even if they are specifically closed. The file lock is only removed once they close Acrobat down entirely. This has cause alot of problems. Has Adobe acknowledged this as a fault yet?
    Thanks.

    Make sure the Preview panel in Windows Explorer is disabled.

  • File Lock with NFS cache

    I use the API FileChannel.lock() to get the file lock for gobal lock based on NFS system, I know that many operations on the NFS system are not atomic because of system cache, but I also know the NFS system has its own lock mechanism, so I don't know if the API FileChannel.lock() is safe as the global lock, which accessed by processes from different nodes.
    OS Linux 2.6.16.60-0.21-smp
    NFS server v3
    NFS Client v3

    Crossposted and answered.

  • File Locking!!! Is this a BUG or there is something wrong in my code.

    In new JDK v 1.4. new means of file locking are introuced, and it seems it is a little bit buggy yet (or maybe this one isn't a one). though it's better than nothing :)
    here is 2 classes. first locks a file, the second attemts to change it.
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    class FileLocker {
      static File targetFile = new File ("D:\\Java",
                                         "manual.chm");
      public static void main(String[] args)
          throws Exception
        RandomAccessFile fin = new RandomAccessFile (targetFile, "rw");
        FileChannel fChan = fin.getChannel();
        FileLock lock = fChan.lock();
        // to let other process to attempt to change the same file.
        Thread.currentThread().sleep(100000);
        lock.release();
        fChan.close();
        fin.close();
    }and the other class
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    class FileWriter {
      static File targetFile = new File ("D:\\Java",
                                         "manual.chm");
      public static void main(String[] args)
          throws Exception
        // this is better/more secure way to access files.
        RandomAccessFile f = new RandomAccessFile (targetFile, "rw");
        // next line deletes the file content even if file locked.
    //    FileOutputStream f = new FileOutputStream (targetFile);
    //--this parts is not needed as the problem is in first 2 lines
        FileChannel fChan = f.getChannel();
        if (fChan.isOpen()) {
          System.out.println("File is Opened, can't write");
        } else
          f.write(-1);
    }so when i use FileInputStream for open stream to write,
    constructor deletes the targetFile (makes it size equal to 0)
    at once i create new FileInputStream object. Since, when i
    use RandomAccessFile to open stream for writting nothing happens.
    after that, f.write (-1); throws exception regardless the way the
    uoutput stream was created.
    So i think there is some problem in FileInputStream class' constructor.

    OK, I know you mean FileOutputStream instead of FileInputStream in the above message. Looks to me like you've discovered a bug in the way Java is locking the file - locking the whole contents of a file (using the no-args lock or tryLock methods) doesn't prevent other programs, including Java, from overwriting some, if not all, of the file. Note that this occurs even on Windows 2000, where exclusive locks appear to be well supported.
    I've found a similar problem where saving from Outlook appears to zero the whole of the locked file. Saving from other programs that are a little more careful, such as XEmacs, appears to only (!) truncate the file to 0, as the FileOutputStream does.
    From what I can tell, in JDK 1.4.2 RandomAccessFiles respect each others' locks, but nothing else does.

  • Problem Loading pdf using AxInterop.AcroPDFLib (file locked)

    Hi,
    I'm currently using AxInterop.AcroPDFLib with C# in a winform application.
    Purpose is to display PDF files in my application. Thoose files are located on a share directory.
    Everything works fine, the program is installed on multiple pc that display the file at the same time without problem.
    BUT, when i open the same PDF file on a computer using acrobat pdf reader, i can't open the same file using the AxInterop.AcroPDFLib dll.
    After some deep search on the files, on the servers, ... it seems to be linked with file locking.
    Let me explain :
    when the file is opened by the AxInterop.AcroPDFLib dll, no lock appears on the server ( share directory ) or at least it appears and is released in the same second.
    when i open the PDF file via acrobat reader, the lock is set, and remain until i close the file in the pdf reader.
    which means that when someone open a file, all the computer using the AxInterop.AcroPDFLib ares blocked and can't start reading the file.
    Is there a way to configure the AxInterop.AcroPDFLib to allow reading on locked files (locked for reading)
    Thanks
    Mike

    I have tried with both Reader 8.xx and 9.xx
    Same behavior.
    After deep investigation, i have found that when i open a file using the reader, this file is marked as opened for "read" on the server, and in that case, the ocx can't open the file...
    when the file is close by the reader, the lock is removed and the ocx could open the document.
    I found also that when the ocx open the file, this file is not locked on the server, which allows other computers with the same ocx to open the same file on multiple workstation (which is the behavior i was expecting).
    thus why is the ocx blocked when a file lock is present on the server for the file to be opened by the ocx...
    Mike

  • ITunes Library File Locked

    Hi,
    Have been using iTunes 10.5 on my WinXP machine - no problems.  During a movie download tonight, iTunes crashed.  Tried to reopen and got the infamous error "iTunes Library file locked or on a locked disk..."  Tried several remedies listed. 
    Verified that MyMusic folder and contents are not READ ONLY.  I am unable to rename, edit, or move the file...she's locked up tight.
    Tried repairing the Windows Registry assignment using the Tweak UI utility discussed in another thread.  No joy.
    Tried starting iTunes from another account on the PC - iTunes boots fine.
    Pulling my hair out (what little is left)...Any ideas out there ???
    HELP !

    Fixed.  For those using WinXP...Here's what I had to do:
    It was a file properties thing as mentioned in other posts, but to change the file properties...
    1.  Boot Windows in SAFE MODE by holding F8 down during bootup
    2.  Log on as Administrator
    3.  Navigate to the iTunes Libary.itl file (My Music/iTunes)
    4.  Right Click and pull up the file properties
    5.  Under Security, re-add the user account to the file permissions
    6.  Then change file permissions to FULL (Read/Write/Edit...)
    7.  Reboot & Viola !
    Once you unlock the write protected status (which got defaulted to the Adminstrator account), iTunes opens just fine. 

  • Why is this file locked (man chflags), does it need to be, and is it safe to unlock it?

    Why is this file locked (man chflags), does it need to be, and is it safe to unlock it?
    ~/Library/Application Support/Adobe/Enterprise/Resources/Resource_3_1.db
    Type this into a terminal in OS X, the above file appears to have a flag set to lock.
    x-man-page://chflags

    <the-sound-of-crickets>
    The reason I'm asking, we have a bunch of computers we inherited that have some permissions issues within each user's respective home directory ("~"). The issue effects Acrobat Pro X's ability to launch ("Internal error occurred") since it tries to get access files/folders it doesn't have access to when the user launches. Recursively setting ownership to the respective user fixes the problem (and follows Apple's guidelines). However, that one file appears to have the unix file lock set (man chflags). So we are using a pre-installation script on our push policy to loop through every home directory. It appears the above file is the only one that won't let us change permissions.
    Don

  • File lock in real time job

    Hi All,
    I encountered an file lock error when creating a real time job.
    After a dataflow, I have a script to move the processed file to archive folder. (e.g. move c:\source\order.xml c:\archive). When I test run it, I received a 50306 error. It saids "The process cannot access the file because it is being used by another process. 0 file(s) moved.". However, the df and script were running OK in batch job. Also, I can move the files manually after the job failed. Can anyone help me with that? Is it something to do with the setting of realtime services?
    Many thanks!
    Knight

    hi,
    Not sure but you can check in sm12 if there is any lock entry, if so than manually delete and than check again.
    Ray

  • File locked, need to unlock it

    Hi all:
    Due to a system crash I have ran fsck to recover the file systems. Then, when rebooting the system, I have found that a Veritas service, called qlogck, claims that its configuration file (/etc/qlogck.conf) is locked. So I must type ctrl-d to continue the boot process. How could I unlock this file, so that the boot process run normally?
    Thanks and regards,
    Felix.

    <the-sound-of-crickets>
    The reason I'm asking, we have a bunch of computers we inherited that have some permissions issues within each user's respective home directory ("~"). The issue effects Acrobat Pro X's ability to launch ("Internal error occurred") since it tries to get access files/folders it doesn't have access to when the user launches. Recursively setting ownership to the respective user fixes the problem (and follows Apple's guidelines). However, that one file appears to have the unix file lock set (man chflags). So we are using a pre-installation script on our push policy to loop through every home directory. It appears the above file is the only one that won't let us change permissions.
    Don

  • CFFILE Holding File Locks

    I have a CF page that reads some tab-delimited text files for
    processing. After it reads a file it then calls a CF page to move
    the file to a new location. It moves the file, but it does not
    delete the old version -- and a filesystem delete on the file fails
    -- it appears as if the CF server has the file locked. If I shut
    down the server and restart it, it clears the lock.
    <cfif #url.vendor# is "LOWES">
    <cflock timeout="10" scope="server" throwOnTimeout="no"
    type="exclusive">
    <cffile action="move"
    source="c:\edifiles\export\#url.fileno#"
    destination="c:\edifiles\export\done\lowes\#url.fileno#">
    </cflock>
    </cfif>

    Generally when manipulating files you used a named
    <cflock> instead of a scope like so:
    <cflock name="#Variables.myFileName#" timeout="5"
    type="exclusive">
    In your code in the second example I'm not sure about the
    function of the loop at all... I guess you are trying to delay to
    make sure the copy operation completes before deleting. But looping
    from 1 to 10 is arbitrary and depending on other concurrent
    processes, server speed, RAM, etc. and so basically it is
    unreliable.

Maybe you are looking for

  • External Hard Drive does not show up in Finder

    My external hard drive is not showing up in Finder. It shows up in Disc Utility, but I do not have access to it. I have tried the following: command-shift c, nothing happens confirmed in Preferences/General that external hard drive was checked tried

  • Accessories not working after updating to iOS 7.0.3

    Why has Apple suddenly decided they need to cripple the iPad and iPhone from using after market accessories? All this achieves is to make attachments and accessories that have enhanced the Apple products for years and rendered them obsolete overnight

  • Pb with servlet ?

    hi i created a web project (just for test) with WSAD, i have only one servlet (ServletForTest) and it's appear in the web.xml web project. when i want to access this servlet from my browser (http://localhost:8080/WebProject8/ServletForTest) i have a

  • KB 2734608 - problem

    Because we have already Win8 clients in our environment i had to try this Patch on my WSUS 3.0 SP2 (which is a SCCM 2007 R3 WSUS). Being careful i installed and tested it first on my lab machine which is a 2003 R2 server. No problem, the installation

  • How to change default scan settings for Preview?

    I use Preview to scan my documents. However the default settings for the scan function of Preview are not what I use. I want to be able to change those default settings to I do not have to change them every time I open Preview. Can anybody let me kno