File Handler Leak?

After we upgrade to 4.0.71 from 3.0, we see multiple file handlers are opened for the last jdb file. We have 100+ clients and each clients have their own environment, thus caused us top the file handler limit on linux.
We are using
OS: Linux 2.6.18-92.1.6.el5 #1 SMP Fri Jun 20 02:36:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
The environment is writable.
I would like to confirm if this is related to the issue fixed in 4.0.92:
Fix a problem where cleaned and deleted log files could accumulate in the log cleaner's backlog, or list of files to be cleaned. This occurs when multiple cleaner threads are configured. The impacts of this problem are:
1. The EnvironmentStats.getCleanerBacklog stat is incorrect, which could lead the application to unnecessarily increase the number of cleaner threads.
2.
3. If EnvironmentConfig.CLEANER_MAX_BATCH_FILES is set to a non-zero value, log cleaning is disabled when the number of deleted files in the backlog reaches this limit.
[#18179]
or is another bug or expected behavior.
To be specific:
I ran the lsof for the berkeley DB directory:
java 13665 mybuys 147r REG 253,0 141869 25927939 /berkeley-db/00000000.jdb
java 13665 mybuys 148r REG 253,0 141869 25927939 /berkeley-db/00000000.jdb
java 13665 mybuys 279rw REG 253,0 0 25927936 /berkeley-db/je.info.0.lck
java 13665 mybuys 280w REG 253,0 0 25927937 /berkeley-db/je.info.0
java 13665 mybuys 281uw REG 253,0 0 25927938 /berkeley-db/je.lck
java 13665 mybuys 282r REG 253,0 141869 25927939 /berkeley-db//00000000.jdb
and note that there are 3 instances of 00000000.jdb. I only see one file hander to this file when server just restart. We have a periodical process to refresh the Berkeley DB from data feed, and we see two handler increased in each refresh. The environment handler, entityStore, and primaryIndex are all singleton per client.
Can someone explain why there is a need to have multiple hanlders opened for one jdb file (and seems always the last one). Is there a workaround with it.
Edited by: JoshWo on Mar 2, 2010 3:14 PM

Everything you asked about is per environment, not per environment handle. In general, we never allocate expensive resources like file handles for each environment handle.
For us, it is not critical to have many file handlers but we just need to be able to estimate before deployment so OS limit can be set correctly (I believe the max is 40K per process on Linux). Any formula to publish?For any environment:
<li> Read-only handles: You can set the maximum to 3, but that is the smallest maximum you can specify. If you only have one log file then only one handle will be open. But if you have 3 log files, then 3 file handles may be opened.
<li> je.lck: 1 handle is always open.
For a read-write environment, there are the following 3 additional handles (added to the above):
<li> Write handle: 1 handle for writing.
<li> Fsync handle: 1 handle for fsync.
<li> je.lck: 1 additional handle for exclusive locking.
Also, you mentioned "maximum number of open-for-read handles is reached". Can you point a documentation link on this parameter or elaborate more here? Is it per environment handler or per environment?EnvironmentConfig.LOG_FILE_CACHE_SIZE is in the javadoc, in the je package.
So overall (if you set LOG_FILE_CACHE_SIZE to 3), you should assume:
-- 4 handles for a read-only environment
-- 7 handles for a read-write environment
I suggest you test this. I'm giving you these numbers by reading the code, not by testing.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Error in creating IO file handles for job (number 3152513)

    Hi All -
    I am using Tidal 5.3.1.307. And the Windows agent that is running these jobs is at 3.0.2.05.
    Basically the error in the subject was received when starting a particular job once it was cancelled and a couple of other different jobs a few days before. These jobs have run successfully in the past.
    This particular job was running for 500+ minutes when it should run at an estimated 40 minutes. At that time it would not allow for a re-start of the job, it just stayed in a launched status.
    Trying to figure out what causes this error.
    Error in creating IO file handles for job 3152513
    Note - from that being said we were to see 2 instances of this process running at the same time, we noticed some blocking on the DB side of things.
    Trying to figure out if this is a known tidal issue or a coding issue or both.
    Another side note, after cancelling the 2nd rerun attempt the following error was encountered: Error activating job, Duplicate.
    When we did receive the Error creating IO file, the job did actually restart, but Tidal actually lost hooks into it and the query was still running as an orphan on the db server.
    Thanks All!

    The server to reboot is the agent server.  You can try stopping the agent and then manually deleting the file.  That may work.  When the agent is running the agent process may keep the file locked, so rebooting may not be sufficient.
    The numerical folders are found as sub-directories off of the services directory I mentioned.  I think the numbers correspond to the job type, so one number corresponds to standard jobs, another to FTP jobs.  I'd just look in the numbered directories until you find a filename matching the job number.
    The extensions don't really matter since you will want to delete all files that match your job number.  There should only be one or two files that you need to delete and they should all be in the same numbered sub-directory.
    As to the root cause of the problem, I can't really say since it doesn't happen very often.  My recollection is that it is either caused by a job blowing up spectacularly (e.g. a memory leak in the program being launched by Tidal) or someone doing something atypical with the client.

  • Handle leak - Crystal for VS 2010

    I've been playing with the Crystal VS2010 runtime and have come across a problem which I believe might be a handle-leak in Crystal Reports.
    I can reproduce this at will using the following example:
    I created a project with a typed dataset (containing 2 empty tables with only a single column each).  I then added a blank report to the project and only added a single text object to it - no data is loaded from the dataset at all.
    Then, I can execute the following 100 times in a loop:
    using (DataSet1 dataSet = new DataSet1())
       using (CrystalReport1 report = new CrystalReport1())
          report.SetDataSource(dataSet);
          report.Close();
       dataSet.Clear();
    This I then follow with a forced garbage collect, just to make sure everything was cleaned up properly.  However, +- 100 new handles were opened and using sysinternals' handle.exe, these show up as Mutexes e.g.:
    1324: Mutant        \Sessions\1\BaseNamedObjects\CrystalReportXalanInitilizeMutex2916l
    I haven't been able to find any information about this on the forums or the internet - can anyone confirm if this is a known issue?  (Or am I doing something stupid? )
    Thanks!

    Hi,
    I've tried some of your suggestions:
    In you report check on No Printer and check off all o f the Verify Database options.  - Made no difference
    Also, be sure to use the Legacy mode in your app.config file, search for it. MS issue with DataSets. - Also, no difference
    GDI Objects  - These don't budge - this is a Mutex leak, not a GDI leak
    As for datasets, I'm not filling the dataset - its empty.  So a database does not enter into the equation, and no database connection handles are therefore ever created.
    Also, I tried the printer theory by running the app on a machine without any printers installed - the problem persisted.  Machines also have entirely different graphics card drivers, so highly unlikely to cause the problem.
    I've also tried targeting both Framework 4.0 and Framework 2.0 - the leak occurs in both cases.
    The code that I posted was only a snippet yes, but it really is 90% of the test-app.  This is the whole content of Form1.cs (a single-button form):
    using System;
    using System.Windows.Forms;
    namespace CrystalLeakTest
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
            private void ProduceReport()
                using (DataSet1 dataSet = new DataSet1())
                    using (CrystalReport1 report = new CrystalReport1())
                        report.SetDataSource(dataSet);
                        report.Close();
                    dataSet.Clear();
            private void button2_Click(object sender, EventArgs e)
                for (int i = 0; i < 100; i++)
                    ProduceReport();
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
                MessageBox.Show("Done");
    The rest of the app is simply a blank report, a blank typed dataset (with 1 table and 1 column - no data).  That really is it
    Is there anything else I can try?
    Thanks!

  • Registry handles leaked from

    +
    System
    Provider
    [ Name]
    Microsoft-Windows-User Profiles Service
    [ Guid]
    {89B1E9F0-5AFF-44A6-9B44-0A07A7CE5845}
    [ EventSourceName]
    profsvc
    EventID
    1530
    [ Qualifiers]
    32768
    Version
    0
    Level
    3
    Task
    0
    Opcode
    0
    Keywords
    0x80000000000000
    TimeCreated
    [ SystemTime]
    2011-06-11T07:37:12.000Z
    EventRecordID
    127007
    Correlation
    Execution
    [ ProcessID]
    0
    [ ThreadID]
    0
    Channel
    Application
    Computer
    Panther-PC
    Security
    [ UserID]
    S-1-5-18
    EventData
    Detail
    16 user registry handles leaked from \Registry\User\S-1-5-21-1082989139-2594333343-3947924465-1001: Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001
    Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001 Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft
    shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001 Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001
    Process 828 (\Device\HarddiskVolume1\Program Files\NVIDIA Corporation\nTune\nTuneService.exe) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001 Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows
    Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\My Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key
    \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\CA Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\Root
    Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\SmartCardRoot Process 2384 (\Device\HarddiskVolume1\Program
    Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\TrustedPeople Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft
    shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\trust Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE)
    has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Policies\Microsoft\SystemCertificates Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Policies\Microsoft\SystemCertificates
    Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Policies\Microsoft\SystemCertificates Process 2384 (\Device\HarddiskVolume1\Program
    Files\Common Files\microsoft shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Policies\Microsoft\SystemCertificates Process 2384 (\Device\HarddiskVolume1\Program Files\Common Files\microsoft
    shared\Windows Live\WLIDSVC.EXE) has opened key \REGISTRY\USER\S-1-5-21-1082989139-2594333343-3947924465-1001\Software\Microsoft\SystemCertificates\Disallowed
    should i be worried or can i get some help with this ?

    I'm having the same problem on one of work's Server 2008 R2 machines, but the software causing the leaks are the Microsoft Windows programs
    cmd.exe
    robocopy.exe
    conhost.exe
    Microsoft can you please stop your software from leaking, thank you.
    From the event viewer
    Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards.  
     DETAIL -
     6 user registry handles leaked from \Registry\User\S-1-5-21-3799963273-679199981-738785089-500:
    Process 2348 (\Device\HarddiskVolume2\Windows\System32\cmd.exe) has opened key \REGISTRY\USER\S-1-5-21-3799963273-679199981-738785089-500
    Process 6532 (\Device\HarddiskVolume2\Windows\System32\Robocopy.exe) has opened key \REGISTRY\USER\S-1-5-21-3799963273-679199981-738785089-500
    Process 2348 (\Device\HarddiskVolume2\Windows\System32\cmd.exe) has opened key \REGISTRY\USER\S-1-5-21-3799963273-679199981-738785089-500\Software\Microsoft\Windows NT\CurrentVersion
    Process 2348 (\Device\HarddiskVolume2\Windows\System32\cmd.exe) has opened key \REGISTRY\USER\S-1-5-21-3799963273-679199981-738785089-500\Control Panel\International
    Process 6700 (\Device\HarddiskVolume2\Windows\System32\conhost.exe) has opened key \REGISTRY\USER\S-1-5-21-3799963273-679199981-738785089-500\Control Panel\International
    Process 6532 (\Device\HarddiskVolume2\Windows\System32\Robocopy.exe) has opened key \REGISTRY\USER\S-1-5-21-3799963273-679199981-738785089-500\Control Panel\International

  • Can't delete file after renaming due to Word file handle still present. Error staes document is still in use but it's really not. Worked fine in 2007 but not in 2010.

    I have some code associated with a Word Template. The template is opened, filled out and saved via a routing in vba. This all works fine in older 2007 version (which is version it was originally created in). Once this file is saved, the user can change the
    date in a text box and re-save document. The code saves using the new date for part of new file name and then deletes that older file from the server. It fails at the delete function because the newer version of word is not dropping the file handle from the
    first named file when user saves it to the new filename. In older version (2007) this handle was released as soon as file was saved to a different name. I can't seem to figure out how to release the old document filename so the old document file can be deleted.
    I hope I explained this well enough.
    Here's the code that woeked in version 2007 but fails in version 2010.
    Option Explicit
    Dim CAPEX01 As MSForms.ComboBox
    Dim CAPEX02 As MSForms.ComboBox
    Dim LocalPath As String
    Dim NetPath As String
    Dim OldPath As String
    Dim OldPathNet As String
    Dim DocName01 As String
    Dim DocName02 As String
    Dim DocName03 As String
    Dim DocName04 As String
    Dim DocName As String
    Dim DocNameold As String
    Dim TestDocName As String
    Dim filesys
    Dim newfolder
    Sub AutoOpen()
    ActiveDocument.ActiveWindow.View.Type = wdPrintView
    TestDocName = ActiveDocument.TextBox2
    OldPathNet = "\\yourPath\" & TestDocName & "\"
    End Sub
    Sub AutoNew()
    TestDocName = ActiveDocument.TextBox2
    OldPathNet = "\\yourPath\" & TestDocName & "\"
     ComboBox1.Locked = False
     ComboBox1.Enabled = True
     FillList1
     FillList2
     End Sub
    Sub DeleteOldDoc()
    OldPathNet = "\\yourPath\" & TestDocName ' & "\"
    DocNameold = OldPathNet & TestDocName & "-" & DocName02 & "-" & DocName03 & "-" & DocName04 & ".doc"
        If Not TestDocName = DocName01 Then
            Set filesys = CreateObject("Scripting.FileSystemObject")
        If filesys.FileExists(DocNameold) Then
            filesys.DeleteFile (DocNameold), True      
     'I get file permission error here
        End If
        End If
    If DocName01 <> "" Then
    If Not TestDocName = DocName01 Then
    If Not TestDocName = "" Then
        MsgBox "Project Proposal Has Been Moved From Year " & TestDocName & " To " & DocName01 & ""
    End If
    End If
    End If
    TestDocName = DocName01
    End Sub
    '''''''Document path functions''''''
    Sub chkpath()
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If Not filesys.FolderExists("\\yourPath\") Then
       newfolder = filesys.CreateFolder("\\yourPath\")
    End If
    If Not filesys.FolderExists("\\yourPath\" & DocName01 & "\") Then
        newfolder = filesys.CreateFolder("\\yourPath\" & DocName01 & "\")
    End If
    End Sub
    ''''''Save Function''''''
    Private Sub CommandButton1_Click()
    DocName01 = ActiveDocument.TextBox2
    DocName02 = ActiveDocument.TextBox4
    DocName03 = ActiveDocument.TextBox1
    DocName04 = ActiveDocument.ComboBox1.Value
    chkpath
    NetPath = "\\yourPath\" & DocName01 & "\"
    DocName = NetPath & DocName01 & "-" & DocName02 & "-" & DocName03 & "-" & DocName04
    ActiveDocument.SaveAs2 FileName:=DocName, FileFormat:=wdFormatDocument
     ComboBox1.Locked = True
     ComboBox1.Enabled = False
     ComboBox2.Locked = True
     ComboBox2.Enabled = False
     TextBox1.Locked = True
     TextBox1.Enabled = False
     TextBox3.Locked = True
     TextBox3.Enabled = False
     TextBox4.Locked = True
     TextBox4.Enabled = False
     DeleteOldDoc
    End Sub
    Sub FillList1()
    Set CAPEX02 = ActiveDocument.ComboBox2
      With CAPEX02
          .AddItem "CASTING", 0
          .AddItem "HOT ROLLING", 1
          .AddItem "COLD ROLLING", 2
          .AddItem "FINISHING", 3
          .AddItem "PLANT GENERAL", 4
          .AddItem "MOBILE EQUIPMENT", 5
      End With
    End Sub
     Sub FillList2()
     Set CAPEX01 = ActiveDocument.ComboBox1
      With CAPEX01
          .AddItem "A Name", 0
          .AddItem "Another Name", 1
      End With
    End Sub
    Private Sub CommandButton2_Click()
        UserForm1.Show
    End Sub

    mogulman52 and Don,
    I went back and looked at my code and had already updated it to SaveAs in the new docx format. It still holds the lock handle in place until Word closes, unlike earlier versions which released the lock handle when you did a SaveAs.
    As a note, all my Word and Excel macro-enabled (dotm & xltm) templates are read only and are never filled in, prompting the user for a file name on any close event or if they run the code gets auto-named. I do the SaveAs and concatenate the file name
    from data on the document (or sheet) that has been filled in. During the SaveAs the docx gets saved to a network folder and also on a local folder. The lock gets renamed to the filename and remains until Word is closed.
    So my code still fails at the point noted below while trying to delete an old filename version after the file has been saved as a new filename in a new folder. So....
    The code is looking in the last folder where the docx file was saved for the older filename so it can be deleted. The newest docx version has already been saved in a different folder and has a new lock handle of its own. That lock is not my problem, it's
    the older file lock which really exists in the same folder as the first filename that the docx was saved to. It does not release that lock until I exit Word. My work around has been to instruct all users to manually delete the older version file.
    The other odd thing is this only happens when I run it from code, if you manually go through these steps with the SaveAs menu drop-downs in Word it will release the lock handle???
    Hope this isn't to confusing and thanks for all your suggestions and help.
    Sub DeleteOldDoc()
    OldPathNet = "\\yourPath\" & TestDocName ' & "\"
    DocNameold = OldPathNet & TestDocName & "-" & DocName02 & "-" & DocName03 & "-" & DocName04 & ".doc"
    If Not TestDocName = DocName01 Then
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FileExists(DocNameold) Then
    filesys.DeleteFile (DocNameold), True 'I get file permission error here- lock handle is still present from last SaveAs command in last folder where previous version of file was saved.
    End If
    End If
    If DocName01 <> "" Then
    If Not TestDocName = DocName01 Then
    If Not TestDocName = "" Then
    MsgBox "Project Proposal Has Been Moved From Year " & TestDocName & " To " & DocName01 & ""
    End If
    End If
    End If
    TestDocName = DocName01
    End Sub
    Glenn

  • How Do RoboHelp 9 WebHelp Generated Files Handle Map IDs and Aliases?

    The text below was written by our team's developer/architect. I am the help author who uses RoboHelp to write content and generate the help files, but I am clueless how it all gets generated and is deployed. Please help. We use RoboHelp 9. I use it in Windows XP and our app and help run on IE 7, 9, and Firefox (multiple versions).
    "Our application uses the numeric identifiers associated with the Map ID. For example, to get to the <appname>_home_page.htm file, we use the number 1053. <appname> = pecs, in this example.
    All of this is used in a call to a RoboHelp method defined in the RoboHelp_CSH.js file. The mehtod we are calling is the RH_ShowHelp() JavaScript method and the code to perform the call, when you click on Page Help, is this:
    RH_ShowHelp(0, ''/pecsHelp/index.htm>pecsHelp',HH_HELP_CONTEXT,topic);
    Topic is translated to the Map ID number for the page help. HH_HELP_CONTEXT is defined in the RoboHelp_CSH.js file. This method translates into a URL and from what I have seen, the URL that gets generated is this:
    http://{server}[:port]/pecsHelp/index.htm/{server}[:port]/pecsHelp/index.htm#<id=1053>>pecsHelp
    Server and port get replaced with the appropriate values. I have no clue how id=1053 is supposed to get translated to mean "pecs_home_page.htm". If you check the PECS_help.h file, you will see the following entry:
    #define PECS_Home_Page1 1053
    Then in the RoboHelp alias file (PECS 3.0.ali), the following line is in the file:
    <alias name="PECS_Home_Page1" link="pecs_home_page.htm"> </alias>
    But both of these files are used during the WebHelp generation process and I don't know how the WebHelp generated files handle the Map ID and aliases."

    You need to assign the numbers you find in the pecs_help.h file to topics in your help. You do this in Context Sensitive Help > Map Files > All Map IDs. (From RH7, but I assume the location is similar in RH9.) This creates the entries in the .ali file.
    Peter Grainge suggests a couple of sites to read for a greater understanding here:
    http://www.grainge.org/pages/authoring/calling_webhelp/using_map_ids.htm
    (Although the second  site is based on RH X5, the basic concepts and procedures should be very similar. )
    HTH,
    Amber

  • Problem with „Empty-File Handling" in PI 7.11

    Hi,
    Iu2019m working in PI 7.11 with file adapter, Sender CC, option: Empty-File Handling: Process Empty Files.
    What I want to do is giving target file the system-date, if the source file is empty.
    But I always get a mapping error in RTWB: Premature end of file.
    It seems that the payload is empty.
    Any idea?
    Thanks a lot in advance!
    Rene Dong
    Edited by: Rene Dong on Aug 31, 2010 4:20 PM

    What I want to do is giving target file the system-date, if the source file is empty.
    The error you are getting makes sense. You should do a check in the mapping, if the payload is empty then use brute force to pass the system date.

  • How do I know if this variable is a file handle?

    G'day
    (This has also been posted on StackOverflow)
    Say I have this code:
    function doFileStuff(){
        var file = "";
        try {
            file = fileOpen(filePath);
            // do stuff with file
        finally {
            fileClose(file);
    If the fileOpen() process fails, the fileClose() call will error. What I need to do is this sort of thing (pseudocode):
    if (isFile(file)){
        fileClose(file);
    I know I can test if file is an empty string still, and this works for me here, but it's not testing what I should be testing: whether file is a file handle. I can check the object's Java class, but this again sounds a bit hacky to me, and there should be a CFML way of doing it.
    There should be something like just isFile(), shouldn't there? I can't find anything like this in the docs.
    Any thoughts / tips? I have gone into more depth in my investigations on my blog. it's too wordy for here.
    Cheers for any help.
    Adam

    That would just defer the issue.. fileOpen() doesn't return a boolean, so I can't go:
    if (fileOpen(filePath)){
         fileClose(file);
    fileOpen() returns a file object; or nothing if it fails.  The whole thing is to identify whether it's a file.  That's the question.
    As per my original, it's dead easy to work around, provided one leverages known side effects of the situation (original variable state; that if it's a file it exposes some public properties; that one can doa  getClass() on it via Java, etc), but one shouldn't have to work around something as fundamental as this.  So I was wondering if I had missed something.
    Seemingly not (based on feedback I've had from various quarters).
    Adam

  • "The document could not be opened. Bad file handle."  Error

    Greetings,
    I have many operators opening documentation using acrobat reader 8.1.2. When the documents are opened, sometimes a change has to be done to the file. I use computer management to "kick" everyone out of the files, update the .pdf, and then they can re-open the file to see the latest and greatest version. The problem is, if not everyone is out of the file, I sometimes get a ""The document could not be opened. Bad file handle." error, and have to usually wait a period of time before it will let anyone in. I think it has something to do with the windows temp files, but am unsure. It's hard to ensure everyone is out of the document on time, as up to 50 people may be in it at the same time.
    Is there perhaps a better way of publishing the new verison of the document?
    Thanks for any help you can provide!

    these two errors below is what I am receiving when do a program integrity scan: common program locations.
    I have done a repair on acrobat reader and I do have the two dll files I even put them in reader folder and still receiving the errors.
    missing file:"c:\program file\adobe\reader 8.0\reader\acrord32.exe"
    "c:\program files\adobe\reader 8.0\reader\acrord32.exe"cannot access a necessary file,"msvcp80.dll
    missing file:"c:\program file\adobe\reader 8.0\reader\acrord32.exe"
    "c:\program files\adobe\reader 8.0\reader\acrord32.exe"cannot access a necessary file,"msvcr80.dll

  • Empty File Handling in xLink adapter

    Helloo Experts
    I am doing a scenario, which creates an empty file(when some mapping condition doesnt satisfy).
    I dont want to write this empty file in the target directory.
    This can be handled if a file adapter is used, but I am using a SOAP AXIS adapter, so I dont know how to handle this here.
    I alaso tried using the StrictXml2PlainBean to avoid the creation, it creates 0 documents and a 0kb empty file.
    Can anyone please let me know how this can be solved????
    Also if some one has done this empty file handling in J2SE file adapter...can you tell how it was done.
    Thanks a lot!!!!!!
    Regards
    Shobha

    Hi Gabriel,
                       You can write a simple script to copy a file from source folder to target in case the fiel size is ZERO bytes. The script will not copy the file if the filesize is more than zero bytes, This will be processed normally by PI server. You can call the script from sender communication channel parameter : "RUN OS command before message processing". Could you please specify the Operating System (OS) you are using in your PI server.
    Regards
    Anupam

  • ***Empty File handling,sender .txt file

    Hi All,
    Can we use the option Empty file Handle if the sender is a text file.
    if so how to achieve this.
    Thanks,
    Srinivasa

    Hi,
    Refer the section of 'Empty File Handling' from the below link:
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    You will get the required result.
    Regards,
    Supriya.

  • Empty File Handling : Do Not Create Message

    Hi,
    I have set this option in Sender CC - file.
    Parameters --> Processing.
    I dont want to pass file to reciever , when file is empty.
    Will the above option  "Do Not Create Message" do the trick.
    OR do i need to choose something else??
    -santosh.

    Santosh,
    Yes. The trick will work for empty file handling.
    When your incoming file is empty then will be no xml message posted to IE and hence receiver will not get any message.
    FYI: Also you can use skip empty files which will do the same but here the files will remain in your source directory.
    Regards,
    Prasanthi.

  • Dupliacte File handling

    Dear All
    I have a querry regarding file handling capabilities at XI ....
    files are coming to FTP Server  XI Picks the file from a FTP server and process to post at R/3
    & file is archives at another folder at FTP server .... some peple at diffrent center post the file again at FTP .....
    is there any way at XI , so that XI did not pick the same file /duplicate file again .....
    how can i achieve this
    Thanks
    Priya

    Hi
    No standard way exists at XI
    look at this pdf
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/99593f86-0601-0010-059d-d2dd39dceaa0
    refer this wiki https://wiki.sdn.sap.com/wiki/x/AoFwAg
    refer this Blog/people/sandeep.jaiswal/blog/2008/05/13/adapter-module-to-stop-processing-of-duplicate-file-ftp-location
    duplicate File name check
    Regards
    Abhishek

  • Duplicate File Handling Issues - Sender File Adapter - SAP PO 7.31 - Single Stack

    Hi All,
    We have a requirement to avoid processing of duplicate files. Our system is PI 7.31 Enh. Pack 1 SP 23. I tried using the 'Duplicate File Handling' feature in Sender File Adapter but things are not working out as expected. I processed same file again and again and PO is creating successful messages everytime rather than generating alerts/warnings or deactivating the channel.
    I went through the link  Michal's PI tips: Duplicate handling in file adapter - 7.31  . I have maintained similar setting but unable to get the functionality achieved. Is there anything I am missing or any setting that is required apart from the Duplicate file handling check box and a threshold count??
    Any help will be highly appreciated.
    Thanks,
    Abhishek

    Hello Sarvjeet,
    I'd to write a UDF in message mapping to identify duplicate files and throw an exception. In my case, I had to compare with the file load directory (source directory) with the archive directory to identify whether the new file is a duplicate or not. I'm not sure if this is the same case with you. See if below helps: (I used parameterized mapping to input the file locations in integration directory rather than hard-coding it in the mapping)
    AbstractTrace trace;
        trace = container.getTrace();
        double archiveFileSize = 0;
        double newFileSizeDouble = Double.parseDouble(newFileSize);
        String archiveFile = "";
        String archiveFileTrimmed = "";
        int var2 = 0;
        File directory = new File(directoryName);
        File[] fList = directory.listFiles();
        Arrays.sort(fList, Collections.reverseOrder());
        // Traversing through all the files
        for (File file : fList){   
            // If the directory element is a file
            if (file.isFile()){       
                            trace.addInfo("Filename: " + file.getName()+ ":: Archive File Time: "+ Long.toString(file.lastModified()));
                            archiveFile = file.getName();
                          archiveFileTrimmed = archiveFile.substring(20);       
                          archiveFileSize = file.length();
                            if (archiveFileTrimmed.equals(newFile) && archiveFileSize == newFileSizeDouble ) {
                                    var2 = var2 + 1;
                                    trace.addInfo("Duplicate File Found."+newFile);
                                    if (var2 == 2) {
                                            break;
                            else {
                                    continue;
        if (var2 == 2) {
            var2 = 0;
            throw new StreamTransformationException("Duplicate File Found. Processing for the current file is stopped. File: "+newFile+", File Size: "+newFileSize);
    return Integer.toString(var2);
    Regards,
    Abhishek

  • HOW: File handling - Date and time of file created/modified

    Hi all,
    Is there any way by which we can find out the date and time of the file created in operating system using file handling through PL/SQL.
    Eg:-
    I have a directory in which I am storing some files, and for a given file name I must know when that file was created, i mean date and time.
    Might be there is some simple way, please help out.
    regards
    CJ

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584#73995149457661
    Remember to get the correct privs (java privs) on the directory.
    Mette

Maybe you are looking for

  • Deskjet 3050 J610 Can't Assign IP

    I recently picked up a wireless printer from HP, and I'm having difficulties setting it up to work wirelessly over my network. I'm running Windows 7 Ultimate and my wireless network is WPA-TKIP. The WPA-TKIP I assume is whats causing the problems. Is

  • OUT PUT ERROR

    HI      WHEN I AM EXECUTING THE FOLLOWING PROG I AM GETTING AN ERROR "MAXIMUM NUMBER OF INTERNAL SESSIONS REACHED". DOES ANY ONE HAS ANY IDEA ABT IT. REPORT  ZSPOOL14. TABLES:TSP01. PARAMETERS: P_EMAIL1 LIKE SOMLRECI1-RECEIVER,             P_EMAIL2 L

  • Cooling fan 902

    Suddenly yesterday I turned on my computer and it ran fine but then the screen went black so I turned it off and when I turned it back on it gave me a black screen and said "the bios has detected that your cooling fan is not working...press enter to

  • Sar -b wcache negative values

    I have a guest ldom running oracle 11.1. DBA's are complaining that it takes them a very long time to perform simple operations in comparison to say, an E6900 running multiple dbs. Comparing apples and oranges I know...but hey. All database file syst

  • Download Freezes?

    I have downloaded several apps from the Creative Cloud successfully, but when I tried to download InDesign, it stops downloading at 90% which means that I cannot uninstall to retry it, and I am not able to install any other apps. Do you have any sugg