What is the design pattern to be used to deal with multiple requests to a share resource in IIS

I have a Lucene Index on a central file system. In my IIS application, I have methods to query the index and another to update the index.

To update the index, I have to lock the file until the changes are committed. My problem in implementing this is choosing the best design pattern to maintain good concurrency.

Am I best off using a static updater class that uses a lock about a static object? If another request to update the index comes in while the lock is active, will the request 'wait' or will it return an exception? If it cannot wait, should I implement a thread safe FIFO type object with the series of operations to conduct sequentially?


What you want is something based on the one reader many writers design pattern.

You should probably update the index as a completely separate operation, in a windows service in some fashion.

Is that an option? Or do you need it consistently 24/7? I suspect you probably don't.

Furthermore, even if you do, you could possibly have your own 'cache' of newly added/removed items that you pass through before going to Lucene.

Category:c# Time:2009-08-18 Views:1

Related post

  • Design pattern code for conditional code scattered across multiple classes 2011-07-20

    Some code needs to be refactored in approx 10 classes, of these classes there are conditionals scattered throughout the classes painting text onto the screen where appropriate. I want to add all this code conditional/painting code into one centralise

  • Why does "Design Patterns" say 'two objects of the same type only need to share part of their interfaces'? 2011-09-01

    On page 13 in the GoF book there is a statement: Two objects of the same type need only share parts of their interfaces. I am not sure I understand this sentence. EDIT: full quote might indeed help to understand that A type is a name used to denote a

  • Is this a design pattern? 2009-04-14

    All over our codebase we have this repeated pattern where there's an interface with one method. Is this a real design pattern? If so what is it and what would the benefits be? Here are a few examples: public interface IRunnable { void Run(); } public

  • Design patterns for managing results of large operations 2009-06-14

    We frequently have objects that perform multi-part operations/tasks. An example would be refreshing internal state of a list of objects based on a query of the file system and reading data from the found files. These things are also often long runnin

  • Java MVC & Composite Design Pattern With Internal Frames 2011-08-28

    Still wondering the best way to do Model-View-Controller Software Architecture, Do I pass the Controller into the View, or do I use the Observer Design Pattern and let the Controller Observe any changes/requests made by the view so we can update the

  • How do I create a Class using the Singleton Design Pattern in Ruby? 2008-08-07

    The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby? -------

  • Do you use design patterns? 2008-08-14

    What's the penetration of design patterns in the real world? Do you use them in your day to day job - discussing how and where to apply them with your coworkers - or do they remain more of an academic concept? Do they actually provide actual value to

  • Design pattern for parsing binary file data and storing in a database 2008-08-14

    Does anybody recommend a design pattern for taking a binary data file, parsing parts of it into objects and storing the resultant data into a database? I think a similar pattern could be used for taking an XML or tab-delimited file and parse it into

  • Can you really build a fast word processor with GoF Design Patterns? 2008-08-19

    The Gang of Four's Design Patterns uses a word processor as an example for at least a few of their patterns, particularly Composite and Flyweight. Other than by using C or C++, could you really use those patterns and the object-oriented overhead they

  • What Are Some Examples of Design Pattern Implementations Using JavaScript? 2008-08-23

    I'm a moderately skilled programmer using JavaScript but I am no guru. I know you can do some pretty powerful things with it, I just haven't seen much other than fairly basic DOM manipulation. I'm wondering if people could provide some examples of tr

  • Best book/resource for learning Java design patterns? 2008-08-24

    I know the MVC design pattern but would be a little unclear about other Java design patterns, so I was just wondering if there's any useful books or other resources you could recommend to get up to speed with these patterns? --------------Solutions--

  • Beyond design patterns? 2008-08-25

    For the past 10 years or so there have been a smattering of articles and papers referencing Christopher Alexander's newer work "The Nature of Order" and how it can be applied to software. Unfortunately, the only works I can find are from James Coplie

  • Abstract Factory Design Pattern 2008-08-26

    I'm working on an internal project for my company, and part of the project is to be able to parse various "Tasks" from an XML file into a collection of tasks to be ran later. Because each type of Task has a multitude of different associated fields, I

  • What is a good online resource for css 'design patterns'? 2008-08-30

    Can anyone out there recommend a good online resource for CSS 'design patterns'? I know design patterns in a software context usually refer to OO based design patterns, but I mean design patterns in the broader sense of the term: i.e. common, clean s

  • What are some real life examples of Design Patterns used in software 2008-08-30

    I'm reading through head first design patterns at the moment and while the book is excellent I also would like to see how these are actually used in the real world. If you know of a good example of design pattern usage (preferably in a OSS program so

  • Data Validation Design Patterns 2008-09-05

    If I have a collection of database tables (in an Access file, for example) and need to validate each table in this collection against a rule set that has both common rules across all tables as well as individual rules specific to one or a subset of t

  • MS-Access design pattern for last value for a grouping 2008-09-06

    It's common to have a table where for example the the fields are account, value, and time. What's the best design pattern for retrieving the last value for each account? Unfortunately the last keyword in a grouping gives you the last physical record

  • Design Pattern for Undo Engine 2008-09-08

    I'm writing a structural modeling tool for a civil enginering application. I have one huge model class representing the entire building, which include collections of nodes, line elements, loads, etc. which are also custom classes. I have already code

  • What is the design pattern for processing command line arguments 2008-09-10

    If you are writing a program that is executable from the command line, you often want to offer the user several options or flags, along with possibly more than one argument. I have stumbled my way through this many times, but is there some sort of de

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 2.049 (s). 13 q(s)