How do I comprehend the execution order about servant locator?

coloradocolorado colorado leeOrganization: devnetworkProject: online scheduleMember
Hi,

In <<Distributed programming with Ice>> charpter 32 about servant locator(Page 869 said), there is a statement:
It is possible for invocations of locate and finished to proceed concurrently
(for the same object identity or for different object identities).

If Ice run like this, when I start a transaction in locate and commit that transaction in finished, is it work correctly?

Ice should guarantees that the execution order is locate, operation, finished.

I can not comprehend the statement. Could anyone explain for me?

Comments

  • xdmxdm La Coruña, SpainJose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff
    Hi
    It is possible for invocations of locate and finished to proceed concurrently
    (for the same object identity or for different object identities).

    When a request arrives for an identity, locate is called, then the operation is invoked in the returned servant, and then finished is called with the given servant.

    So if multiple request arrives concurrently, locate and finished could be runing concurrently even for the same identity.
    If Ice run like this, when I start a transaction in locate and commit that transaction in finished, is it work correctly?

    This works correctly if each servant instance use is own transaction, when locate is called you return a new servant with a transaction opened, then the operation runs, and when finished is called you decide if you want to commit or roll back the transaction.
    Ice should guarantees that the execution order is locate, operation, finished.

    I can not comprehend the statement. Could anyone explain for me?

    This means that for a given request dispatched throw a servant locator, is always true that, locate is called on the servant locator, the operation is invoked in the returned servant, finished is invoked in the servant locator with the servant returned by locate.

    Let us know if you need further clarifications about that.

    Cheers,
    José
  • coloradocolorado colorado leeOrganization: devnetworkProject: online scheduleMember
    Hi,José

    "So if multiple request arrives concurrently, locate and finished could be runing concurrently even for the same identity."

    I know that locate and finished could be runing concurrently for multiple request even for the same identity,but they are running in a fixed order for a specific request.

    Is it right?

    Thanks for your reply!
  • coloradocolorado colorado leeOrganization: devnetworkProject: online scheduleMember
    This means I must find out the specific request from multiplue requests using the parameter "current" If I want apply a transaction to the request in a fixed order.
  • xdmxdm La Coruña, SpainJose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff

    I know that locate and finished could be runing concurrently for multiple request even for the same identity,but they are running in a fixed order for a specific request.

    Is it right?

    Yest that is right.
    This means I must find out the specific request from multiplue requests using the parameter "current" If I want apply a transaction to the request in a fixed order.

    I'm not sure what kind of transactions do you want to use, and how you expect it to work, if you could give a more detailed description of what you are trying to do , we will be able to give you better advice.

    BTW what language mappings are you using in your project?

    Cheers,
    José
  • coloradocolorado colorado leeOrganization: devnetworkProject: online scheduleMember
    I am afriad I may not make a clear explanation on my purpose. I think I understand the statements. The scenaio using transaction in locate and finished is only hypothesis. But the hypothesis is worng, the transaction can wholely be used in the operation,not beginning in locate and committing in finished.

    I have used C++ in learning ICE.

    Thank you for your help.
Sign In or Register to comment.