Results 1 to 5 of 5

Thread: replication

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2008
    Posts
    17

    replication

    scenario:



    -folder x resides on server a, server b ,server c

    -x contains same set of files in a,b,c



    whenever any file gets modified in a, it should get also modified in b and c as well

    similarly b->a,c and c->a,b



    my idea of implementaion is

    -when ever any file is modified on a server, compare timestamps and force copy the modified in the other two



    How should i go for implementing it?

    1)how to check if a file is modified

    2)how often this check should be done and how this should be implemented



    should a service be running to perform thi check



    i want to do this using .NET



    Let me know your thoughts and suggestions

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: replication

    You may try using the FileSystemWatcher class. Here is a sample.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: replication

    Use FSW and to make it more robust, use an MSMQ or BizTalk or something reliable for message queueing. The problem with FSW is that it is not entirely reliable if you attempt to start copying the file over immediately, especially if a large file is still being written to disk or if another process has a lock on it.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    May 2008
    Posts
    17

    Re: replication

    @dee u

    good article. i have follwed the steps in the article you mentioned but i have the following error

    "Cross-thread operation not valid: Control 'txt_folderactivity' accessed from a thread other than the thread it was created on"

    any thoughts?

  5. #5
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: replication

    The error is very straightforward. You are trying to access the textbox from a thread other than the UI thread. I'm going to guess this has to do with the FSW being triggered. Take a look at this tutorial for accessing controls across threads.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width