On Wed, Dec 1, 2010 at 8:36 AM, OpticTygre <[email protected]> wrote: > Hi all, > > I'm currently developing a windows service in VB.NET that will be > deployed on multiple machines. The services are responsible for > polling a specific location on a shared file system and consume the > files therein. A website is responsible for initially placing the > files in this shared file system location. > > I'm not sure how to design my service so that when it is deployed on > multiple devices and begin reading and consuming files, those files > are locked so that other instances of the service cannot access them. > > A single instance of the service must: > -Get a list of the files on the shared file system > -lock the files so that other instances of the same service on other > devices do not access them > -backup the files to predetermined locations > -Open, read, and consume the data contained within the files > -delete the files from the original directory > -be able to recover from programmatic crashes during file consumption > so the files do not end up in a "limbo" state when the service is > restarted. > > Any ideas or examples out there on how to do this? I've thought about > the simple "rename" solution, but it is prone to errors if a process > crashes, since other instances of the service will never look for > renamed files. --------------------------
First thought is a transaction table for your inventory of files table. I just want to know how the user will notify you that they are finished with use of the file? That message back would reset the "lock" attribute of the system. -- Stephen Russell Sr. Production Systems Programmer CIMSgts 901.246-0159 cell
