Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2007

Tip: Looking for answers? Try searching our database.

Threading issue with COM Wrapper object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian - 04 Apr 2007 23:53 GMT
I have run into an issue with a web service I am working on that uses
an object defined in a COM Wrapper.  There can be only once instance
of this object initialized at a time on the system, which is naturally
causing problems in ASP.NET 2.0 Web Service.
How does one go about managing this type of resource?  Is it possible
to create an instance of an object that is shared across all the
threads created by multiple users hitting a web service?  How does one
handle the process of initializing/disposing of such an object?
I'm a bit new to Web Services, so I really would appreciate any help
available.
-Brian
John Saunders - 05 Apr 2007 18:01 GMT
>I have run into an issue with a web service I am working on that uses
> an object defined in a COM Wrapper.  There can be only once instance
[quoted text clipped - 6 lines]
> I'm a bit new to Web Services, so I really would appreciate any help
> available.

I wouldn't host the wrapper in ASP.NET, for reasons you've already seen.
Instead, host it inside of a Windows Service, and use .NET remoting between
the Web Service and the Windows Service.

John
Latish Sehgal - 05 Apr 2007 21:56 GMT
Can't the wrapper be hosted in ASP.NET by using the Singleton pattern
for implementation and keeping the object in the Application or Cache
object depending on the requirements?
Brian - 06 Apr 2007 00:45 GMT
> Can't the wrapper be hosted in ASP.NET by using the Singleton pattern
> for implementation and keeping the object in the Application or Cache
> object depending on the requirements?

That's an interesting idea, Latish.  I had the singleton pattern set
up, but was unsure how to proceed.  I hadn't heard of the Application
or Cache until now, so I will be doing some research on it.  Does
anyone else know if this is an effective option?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.