Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3221430
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:52:30+00:00 2026-05-17T15:52:30+00:00

My scenerio is like this: On the server there is an application which exposes

  • 0

My scenerio is like this:

On the server there is an application which exposes a COM object allowing to interact with this application programaticaly. However I can connect only once through COM due to licence restrictions. So, after initialization a COM object will return me a more specified ConnectionObject.

I need an advice what management model I schould chose for my service which will be interacting with the ConnectionObject:

Per-Call Service:

I have two options here:

  1. I can log through COM, perform operation and Logout releasing the connection. But this logging process is somewhat time consuming.

  2. I could create some sort of
    singleton class which could keep
    reference to the ConnectionObject.
    The problem is that I do not know
    how to share the same instance of
    object through different instances
    of the service? Is it possible?

Singleton Service:

The problem of sharing ConnectionObject does not exists. Object will be created at the begining of life of the service and freed when service will be shut down. However I’ve read that using this kind of service is not recommended.

Thanks for any advices.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:52:31+00:00Added an answer on May 17, 2026 at 3:52 pm

    Given your requirements with the COM object, and the time consuming log in and out process – I would go with the singleton service. We use our WCF services like this all the time (also talking to legagy COM objects).

    You can add the following attribute to the class definition of your WCF service to get the behaviour:

    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] 
    public class MyService : IMyServiceContract
    {
        [OperationBehavior]
        public void MyServiceCall ()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario I have an application using asp.net Master Pages in which I would like
I work on a chat-like application, where I use Silverlight on the client side
I have a web application deployed in an internet hosting provider. This web application
I would like to implement a producer/consumer scenario that obeys interfaces that are roughly:
I'd like to stick a class down in my folder hierarchy. The scenario is
Scenario is that we send out thousands of emails through SMTP server. Content is
Scenario: I have a project containgin two C# projects, which for historical reasons must
Here's my scenario. I have an application written in C++ but not the complete
i'd like to recieve comments on the way i'm trying to build an asp.net
I am working on the development of a web based application on codeigniter. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.