a question

simpleysimpley Member ✭✭
as i have said before, I want to use ice in one of my project, and in my project, I should implement an object with a member pointer which ponit to a database connection object, then the quesiton is:
when a client invoke the object I implemented in server side with the database's username and password, the client gets a ptr of this object, but, before this client release this object, another client invoke the object again with another peer of username and password, then the ice dispatch this invoke to the same object actived before, so the object's contents changes to the later and the previous client will lost the object him invoke before, I know I can implement an object factory to deal it, but I want to know what my thinking is right or not and if I can implement by another way without object factory?
thanks

Comments

  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hello,

    Yes, using a factory to manufacture an Ice object per client (or username) makes sense.
    In your scenario, it also makes sense to create one servant for each of these Ice objects ("incremental initialization"); you could also use a default servant, but I don't see any advantage here. I recommend you read "16.7 Servant Implementation Techniques" in the Ice 1.2 manual.

    Cheers,
    Bernard
  • simpleysimpley Member ✭✭
    thanks bernard
Sign In or Register to comment.