rahuldagr81's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
5 (0.01 per day)
Joined:
01-July 11
Profile Views:
215
Last Active:
User is offline Jul 01 2011 03:41 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   rahuldagr81 has not set their status

Posts I've Made

  1. In Topic: Directory watcher false event throw

    Posted 1 Jul 2011

    Yes makes sense.
    Thanks xheartonfire43x, for your quick and useful response.
    Thanks alot.




    View Postxheartonfire43x, on 01 July 2011 - 12:45 PM, said:

    I'm not really sure why that is. I am going to assume that it is the way the directory watcher works.

    What I am betting happens is that ColdFusion isn't actually running a "watcher" but a scheduled task that runs once a minute or so that checks the directory. It scans through the directory and checks all of the timestamps against a stored list of timestamps. If there is a change in the stamp then it says "Hey, here's a new file" and passes it onto your code. I can't remember for sure, but I think I remember windows always having weird things happen when Java tries to read file's time stamps.

    In looking at Railo's source code I can verify that the directory watcher there checks the file's last modified date. I can't say for sure, but I assume that Adobe ColdFusion runs similarly. I highly doubt that it would be running some sort of in file delta to check changes within an actual file.

    If I am correct that Java (reminder that ColdFusion is just a servlet that compiles down to Java) has issues with Windows time stamps, then that is why you would be having inconsistent problems.
  2. In Topic: Directory watcher false event throw

    Posted 1 Jul 2011

    Hi xheartonfire43x
    Thanks for nice and useful explanation.
    I just have 1 more question

    Quote

    Since this is a new connection CF is now like "Whoa, all these files are new! Okay well imma go do some copyin' now."


    In my case, this doesn't happen every time, sometime it happens sometime its not. once in month it happens so.






    View Postxheartonfire43x, on 01 July 2011 - 12:00 PM, said:

    As far as what I think about the server path I have a strong theory about it.

    I will refer to the CF Server as ServerA and the server that you share is on as ServerB.

    When you connect to a server through //serverb/directory you are essentially doing the same as a <cfinvoke /> command. It is designed to do the following:

    • Connect to the server
    • Open the directory
    • Perform necessary actions
    • Close the connection


    It is not designed for a maintained connection to the server. So eventually the connection to the server times out when ServerA goes into an idle process. A little bit of time passes and suddenly ServerB has a new file on it so ColdFusion connects to the share, which in turn takes ServerA out of the idle process. Since this is a new connection CF is now like "Whoa, all these files are new! Okay well imma go do some copyin' now."

    When you setup a mapped share you are doing something similar to the createObject() function which is designed to maintain an open connection. This process follows this method:

    • Connect to the server
    • Open the directory
    • Perform necessary actions
    • Store the connection in memory so that I can keep using it


    I am slightly more sure of the first part of this explanation than this part.

    Reminder this is only a theory, so don't go to your sysadmin and say "Well xheartonfire43x said that this is what happens so do it this way!" In my past experience with sysadmins that is a sure way to NOT get stuff done.
  3. In Topic: Directory watcher false event throw

    Posted 1 Jul 2011

    Hi xheartonfire43x,
    Thanks for quick reply, and you may be right as I am NOT using mapped network, I am using full server path.
    I will give it a try with mapped network drive.
    your suggestion makes sense, but can you please let me know why using //servername/scans may be a problem.

    Thanks



    View Postxheartonfire43x, on 01 July 2011 - 10:54 AM, said:

    I don't think that the problem is the code at all, but the fact that you are trying to monitor a network based directory. My first question to you is how are you connecting to the shared directory? If you are not using a mapped network drive then that could be your problem right there. When you monitor a directory at something like //servername/scans for example you may run into issues where the server isn't maintaining a constant connection to the shared network drive and therefore it is screwing ColdFusion up.

    The alternative method is to map a network drive. If you aren't sure if you are using a mapped network drive then look at the path you are watching. If it is a drive based path, z:/scans, then you have a mapped drive. If you don't have it setup that way and don't have the powers to do so or don't know how then give you sysadmin a call and ask if he can set that up for you.

    If you do have a mapped network drive then I would suggest testing this on another CF server and testing the same code and directory watcher configuration on a local directory located on the server.
  4. In Topic: Directory watcher false event throw

    Posted 1 Jul 2011

    This is code and problem I explained above.
    Please help me.


    	<cffunction name="onAdd" output="no">
    		<cfargument name="CFEvent" type="struct" required="yes">
    		<cfset data = CFEvent.data>
    		<cfset holdInfo = GetFileinfo("#data.filename#")>
    		<cflog application="No" file="vortex" text="ACTION: #data.type#; FILE: #data.filename#; PATH: #holdInfo.Parent# ">
    
    		<cfset copy_path = 'Server1\folder1'>
    
    
    		<cfinvoke component="FileProcess" method="Copy" returnvariable="Variables.Result">
    			<cfinvokeargument name="SrceDirNme" value="#holdInfo.Parent#">
    			<cfinvokeargument name="SrceFleNme" value="#holdInfo.Name#">
    			<cfinvokeargument name="TrgtDirNme" value="#copy_path#">
    			<cfinvokeargument name="TrgtFleNme" value="#holdInfo.Name#">
    		</cfinvoke>
    		
    		<cfreturn>
    	</cffunction>
    
    
    
    



    View PostCraig328, on 01 July 2011 - 10:31 AM, said:

    Hi rahuldagr81 and welcome to DIC!

    What would you like us to do to help? You've posted nothing we can look at except a generic description of a problem you're having. No code means no specific suggestions for a fix. What have you tried to fix this? Presumably you wrote the code that's firing...what have you tried to troubleshoot your problem.

    Have you looked elsewhere on the web? I did and came up with this link about the common pitfalls associated with DW code.

    Anyway, if you did write this malfunctioning piece of code, feel free to post it here so we might actually be able to render specific suggestions.

    Good luck!

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

rahuldagr81 hasn't added any friends yet.

Comments

rahuldagr81 has no profile comments yet. Why not say hello?