Is it possible to disable Collocation Optimization?

I'm programming components, which internally communicate using Ice, but are to be used by other people, who don't need to know the details of the communication.

Therefore it is possible, that 2 or more components end up inside the same process, but that is depended on code written by other people.

My problem is, that I'm using AMD in cases, where I can't predict the load to be expected.
And at that point components sharing the same Communicator end up catching a CollocationOptimizationException.

Is there a workaround to this problem, or is it possible for me(expecting the probability of more than 1 component ending up inside the same process to be relativly small) to disable the collocation optimization?

You can easily disable collocation optimization on a per-proxy basis. For example:

MyPrx p = ...
p = p->ice_collocationOptimization(false);

Hey,

thanks! This worked for me as well (ice_collocationOptimized(false)).
But I'm wondering, because I'm using async calls in other programs as well and I never had to set collocationOptimized to false. It just worked. But in my current pogram I get a collocation optimization exception if I don't set collocationOptimized to false.
How can that be?

What version of Ice are you using? Collocation optimization was improved in Ice 3.6b (and soon to be released 3.6.0) so that asynchronous calls now use collocated invocations if possible. Prior to 3.6b, asynchronous calls always went over the wire, meaning enabling/disabling collocation optimization had no affect on them.

What version of Ice are you using? Collocation optimization was improved in Ice 3.6b (and soon to be released 3.6.0) so that asynchronous calls now use collocated invocations if possible. Prior to 3.6b, asynchronous calls always went over the wire, meaning enabling/disabling collocation optimization had no affect on them.

I'm using Ice 3.5.1. Maybe other programs run with 3.5.0 but not 3.6b

I'm using begin_ and end_ to make an async call (so not the option ["amd"] in the slice file). Perhaps this also makes a difference?