Archived

This forum has been archived. Please start a new discussion on GitHub.

Multiple objects with IceGrid

Hi,

I'm testing your Allocate IceGrid demo, and I don't understand why the client can only create a Hello object in the simple case.

This is the xml configuration file:

<icegrid>

<application name="Allocate">

<node name="localhost">
<server id="AllocateServer" exe="java" activation="on-demand">
<option>Server</option>
<adapter name="Hello" endpoints="tcp" register-process="true">
<allocatable identity="hello" type="::Demo::Hello"/>
</adapter>
<property name="Identity" value="hello"/>
</server>
</node>

</application>

</icegrid>

I would like to create 1 object per connecion, without restrictions (10 clients, 10 objects, i.e). I have tried with <property name="Hello.ThreadPool.Size" value="5"/> but it doesn't work.

Thanks a lot your time :)

Cheers

Comments

  • Hi again,

    I'm sorry... I have change my new signature :P

    Cheers
  • benoit
    benoit Rennes, France
    Hi,

    The demo doesn't create one Ice object per client -- it demonstrates the IceGrid allocation (in the sense of reserving or leasing) feature of Ice objects: when a client allocates an object, other clients can't allocate the object until it's released. See the Ice manual for more information on the IceGrid allocation mechanism.

    If you want to allow multiple clients to invoke concurrently on the same object, you don't need to use the IceGrid allocation mechanism (just take a look at the IceGrid simple demo).

    If you want to have one object per client, you need to implement a factory on the server to allow the client to create objects. You'll have to make sure to correctly clean up the server resources when the client goes away. I recommend you to take a look at the Issue 3 of the Ice newsletter for more information on how to do this (and at this FAQ for the reason why tying the object lifetime to the connection is a not a good idea).

    Cheers,
    Benoit.
  • Hi benoit,

    ok, I understand what you mean to me :D

    Thanks a lot for helping me :D

    Best regards!