ice_getConnection - results: connection from connection cached, not actual manually closed

in Help Center
result ice_getConnection mayby not actuall connection.
is it bag or normal?
auto instance_prx = _communicator->propertyToProxy({}); auto connection = instance_prx->ice_getConnection(); // new connection connection->close(::Ice::ConnectionClose::GracefullyWithWait); // results: connection from connection cached, manually closed connection = instance_prx->ice_getConnection(); **// fail results !!** // workaround instance_prx = _communicator->stringToProxy(instance_prx->ice_toString()); connection = instance_prx->ice_getConnection(); // new connection
Tagged:
0
Best Answer
-
benoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
Hi,
Ok it's not a bug,
ice_getConnection
returns the cached connection without checking its state. The closed cached connection will only be cleared once you invoke an operation on the proxy. You can disable connection caching if you want the proxy to obtain a new connection the second time.Cheers,
Benoit.0
Answers
Hi,
The second call to ice_getConnection after the connection close should re-establish a new connection and succeed. Isn't this what you are observing? What do you expect?
Cheers,
Benoit.
I see : ice_getConnection - connection from connection cached.
Version: ice3.7.1
Hi,
Ok it's not a bug,
ice_getConnection
returns the cached connection without checking its state. The closed cached connection will only be cleared once you invoke an operation on the proxy. You can disable connection caching if you want the proxy to obtain a new connection the second time.Cheers,
Benoit.