Accessing pooled object from web application

Posted on 2006-03-21
Medium Priority
Last Modified: 2010-04-16
Dear Friends
   I need guidance for below problem
 A win app which should instantiates say 5 object in an ary.And a web application residing in the same machine should access the objects from the memory.when 'user A' logsin the web app should search for  available free object(out of 5) from the memory and that object must be locked until unless 'user A' logsout in between if 'user B' logsin it should search for free object(out of 4) .At a time 5 user should access 5 differrnt object  
thanks in advane

Question by:dees
LVL 10

Expert Comment

ID: 16246160

use constucter of that class and with the help of  variable you can keep track of those object
LVL 12

Accepted Solution

AGBrown earned 1000 total points
ID: 16247748
There are lots of ways to implement a pool, but the real problem is sharing the objects between two different applications on the same machine. I have to say I don't know a simple way of doing that.

One solution (not simple) will be to implement a Remoting service on IIS. This will host the pool as a Singleton object (an object of which there can only ever be a single instance of in a given application space). Your pool will be a collection of the objects that you want to pool. Each of these will be stored along with a flag that indicates if they are free or not. You will also need to implement some kind of pool manager that will maintain the pool and solve problems such as permanently checked-out objects caused by application crashes etc.

This is not a simple problem, and therefore it won't have a simple solution, but with a little persistence you will be able to pull it all together. I couldn't find many good background articles, so I would first read up on what a singleton design pattern is:

Then have a look at this for an idea of one method for implementing a singleton in .NET on IIS:

If you think you can do all that, then you need to design your pool. You can use System.Collections.CollectionBase as the base of the collection that will hold you pooled objects, but you will need to do something along the lines of storing a wrapper class that will also store attributes such as CheckedOut, TimeOfCheckOut, UserWhoCheckedOut etc. Finally you need to decide on your pool management strategy, and design a timer-based class that is created with the pool and that looks after the pool.


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question