DCOM - Creating a single server instance

I am facing a peculiar problem when I am using the remote data module.( File -> New -> Multi tier -> remote Data module)

I made a simple application server using remote data module object (myserver).Saved it on a machine 1 as 'server.dpr'. Ran it once.( so it gets registered).

I made a simple client with a dcom connection object and set its properties
computer name = 'machine1'
server name = 'server.myserver'

 Placed the client on machine 2 and machine 3

a) Ran a client on machine 2 and machine 3
But i see that it creates an instance on machine 1 for each client.

b) I ran 2 client  instance from machine 2 and surprisingly it doesnt open a new instance

c) I went and changed the (dcomcnfg.exe) identity tab to 'interactive user'
When i do so clients from machine 2 and 3 ,are not able to access the server at all.

The code where i am focussing is

 1)
 TComponentFactory.Create(ComServer, TMyApartment,
    Class_MyApartment, cimultiInstance, tmApartment);

and

2)
class function CoMyApartment.Create: IMyApartment;
begin
  Result := CreateComObject(CLASS_MyApartment) as IMyApartment;
end;

class function CoMyApartment.CreateRemote(const MachineName: string): IMyApartment;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_MyApartment) as IMyApartment;
end;

Can you throw some light on this issue of mine.
nayakgaAsked:
Who is Participating?
 
ziolkoConnect With a Mentor Commented:
open dconcnfg and set apropriate Launch and access permisions.
ziolko.
0
 
PeterLarsenCommented:
But what is the question ?
0
 
nayakgaAuthor Commented:
Thanks for replying .I was waiting for somebody to reply.
I want one server instance to service all client requests.
But I see that it creates an instance per client.

How do i avoid from doing so.

Ganesh
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
PeterLarsenCommented:
Well, i dont know much about TComponentFactory.
ciMultiInstance, tmApartment should work.

Normally i use File-New-ActiveX-Automation Object and use TAutoObjectFactory to initialize the server.
0
 
nayakgaAuthor Commented:
How would you access remote datasets if I used the way suggested by you.

I tried the way told by you but then I cant use the power of client datsets on client application , and providers and remote datasets on server application.These are (I guess) only available through File-New-Multitier-remote Data module.

0
 
PeterLarsenCommented:
Will look into it ...
0
 
CleanupPingCommented:
nayakga:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
All Courses

From novice to tech pro — start learning today.