Archived

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

How to marshal a proxy to freeze db?

hi,
In the 33.7.2 section of the manu, it is said that :

The proxy returned by the connection’s createProxy operation can only be used in the server process and cannot be marshaled or stringified by proxyToString.

It seems to mean that this type of proxy can not be freezed to a database.
Although I am not very sure about it but in my program a execption "Cannot marshal a fixed reference" always was thrown.

Now I faced a problem how to persistently save a callback proxy to database in bidir situations. Maybe I can save the connection->toString() , but I don't know how to simply get the proxy reversely from this string.

There must be some easy way to marshal this type of proxy to freeze and hope getting helps.

Thanks in advance.

OrNot

Comments

  • There is no way to marshal a fixed proxy or to store it in a Freeze database. Doing so wouldn't make any sense, because the proxy has no meaning once the connection it is fixed to doesn't exist anymore. That is, a fixed proxy is inherently transient, and therefore it cannot be made persistent. However, you can store the identity, and create a new fixed proxy using this identity.
  • The scenario I had thought was that a client had connected to a server via bidir and the server accidently was turned off and restarted. I had wanted that the original proxies ,which were once saved in freeze , could continue to work without needing the client to re-register the proxies of themselves with the server.

    If I store the identity and create one new proxy, I am afraid that the new one would not work correctly in bidir mode.

    That's to say, there is no way to achieve what I had thought?
  • If the server is turned off and restarted, the client must establish a new connection to the server. The Ice core has no way to somehow find out that an old fixed proxy now belongs to this new connection. Only application code can have this knowledge, i.e., application code must create a new fixed proxy for the new connection from a given identity.
  • Thank you Marc. Your answer is very clear.

    I am always tring to find a solution to deal with the situation that
    the server was accidently turned off and restarted but I hope the client does
    not realize this and the c/s can contiune to work as before ( assuming during the peirod of the server's down ,no requests/response between them).
    The main reason is that the client can not be restarted by us.
    Of course this has beyonded the scope of ICE ,but you must have many experiences and may give me some advice. ( ;) , Marc, not commerical request,just a pupil's question to his teacher. Thank you any way.)
  • Fixed Proxy Definition?

    Hi,

    Can someone please define "fixed proxy" for me? I didn't turn anything up in the docs.

    The freeze documentation shows proxies being stored using freeze (see NodeDict and NodeRef in the file system example). If the proxy is using endpoints that define the machine on which the proxy is stored (localhost, or whatever), is this OK?

    Thanks for any info.

    -- Andrew Bell
    Iowa State University - Center for Survey Statistics & Methodology
    andrew.bell.ia@gmail.com
  • Have a look at chapter 33.7. The proxy created with Connection::createProxy() is called a "fixed proxy", because it is fixed with respect to an existing connection, i.e., it will only use the connection which has created the proxy. If this connection ceases to exist, the proxy will not (and can not) establish a new connection.

    You are right, our documentation doesn't use this term. We will either change the documentation, or I will not use the term "fixed proxy" here anymore :)

    You can of course store all other proxies in Freeze (direct proxies or indirect proxies), just not those which are created with Connection::createProxy().