473,322 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Threading issues with COM in Web Service

I'm writing an application that will run as a Web Service. It will
communicate with some old COM DLLs. These COM objects need to be
called on their own thread. In a regular Web Service I would create a
pool of objects that I call so I don't have to instantiate, log in,
etc, on each Web Service call.

How can I do this? Are there performance issues to keeping an object
on a thread for an extended period of time? Do I have to write
wrappers so that I can pass and retrieve parameters?

Thanks for the advice.
Nov 15 '05 #1
1 1365
> called on their own thread. In a regular Web Service I would create a
pool of objects that I call so I don't have to instantiate, log in,
etc, on each Web Service call. I'm not sure what you mean here. Do you mean "In a reguler web page i would
....."
You can implement a singleton pattern which would wrap an object factory so
that specified objects are returned to the caller. This isn't quite
straightforward because webservices are inherently stateless so you would
have to create the statefullness programatically using a durable datastore
or caching.

You can pass parameters as long as they implement ISerializeable (use the
<serialable> attribute) as the component object needs to be pushed across
the wire. There are some gotchas with serializeable objects for webservices
depending on the soap formater (binary or not) which you need to pay
attention to. Serializable custom classes must allow all their members to be
serializeable as well.

Are there performance issues to keeping an object on a thread for an extended period of time? No not really, performance is only an issue because of the persistence of the object in server memory or
wherever the durable data store happens to reside. Big objects will take up
lots of memory for extended periods of times

Do I have to write wrappers so that I can pass and retrieve parameters? This would all be encapsulated in your singleton pattern. Whatever you are
passing must implement ISerializable if it is not an intrinsic type. So you
would basically build a class which knows how to produce an object and keep
track of it.

You really need a solid resource like 'Distributed Applications' matthew
MacDonald before walking this path. There are a lot of pitfalls with that
approach which can affect scalability and performance if not properly
implemented. Also, have a look at www.prosetech.com they've some
implementations close to what you are looking for.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"A.J." <re**********@yahoo.com> wrote in message
news:94**************************@posting.google.c om... I'm writing an application that will run as a Web Service. It will
communicate with some old COM DLLs. These COM objects need to be
called on their own thread. In a regular Web Service I would create a
pool of objects that I call so I don't have to instantiate, log in,
etc, on each Web Service call.

How can I do this? Are there performance issues to keeping an object
on a thread for an extended period of time? Do I have to write
wrappers so that I can pass and retrieve parameters?

Thanks for the advice.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: KC | last post by:
Could someone elaborate on any possbile issue storing an XmlSchema object statically for reuse. I am dowloading, reading and compiling a schema from an external url. I am then saving the...
0
by: omyek | last post by:
Heh, I know some of you have read the subject and are wondering what in the heck I'm doing. Well, for all intensive purposes, I've had to embed a WebBrowser control into a DLL and reference that...
4
by: Ryan Gregg | last post by:
I've got a background service running that needs to check a database periodically and print reports whenever it finds that the data has changed. I've built a class library that scans the database...
6
by: CK | last post by:
I have the following code in a windows service, when I start the windows service process1 and process2 work fine , but final process (3) doesnt get called. i stop and restart the windows service...
2
by: linesh.gajera | last post by:
Hi Guys, I am creating a Windows service that call a routine at given interval. Once routine is complete, windows service should wait for 5 minutes and then call the routine again. I was using...
0
by: BergRD | last post by:
For some odd reason my original post was double posted then removed from the forums. Odd happenings but wanted to re-post incase no one saw the original, thanks :D > Salutations! > > New to...
2
by: greg.merideth | last post by:
I have a project where we have a windows service that creates a remoting object for an external client application to communicate with using ipc. We've discovered the client is making updates to...
4
by: Giovanni | last post by:
Hi All, I need help with the following: Using VB.NET 2005, I am building a custom class in a separate assembly. The purpose of this class is to poll the internet to determine connectivity. I...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.