Skip to main content

VBJ QOS policies doesnt work first time with _non_existent()

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

VBJ QOS policies doesnt work first time with _non_existent()

Resolution:

[Pre WRAP] Beer Problem Description: Full Product version(s) : VBC 51Full Platform version: HP-UX & (All -Platforms)JDK version, where applicable:NACompiler version (for Enterprise) :NAApplicable component : QoSWhen you call _non_existent() to check the existence of the object before you set the QoS policies at ORB level. Then, the QoS policies does not work first time when a method is called, but when that method is called again, then the policy has effect.BeerResolution: Vantive : For this behaviour to include in the documentation.I have created a Enhancement Request. ( 37690) When an object reference is created it inherits all Qos policies from ORBlevel policies. If we set any polices at object level these override thepolicies set at ORB level. The policies set at object level come into effectduring the first method invocation. Once a method is invoked and if anychanges are made to the policies at object level, it will not affect thepolicies of the existing reference.If you see the signature of set_policy_overrides at object level,Object set_policy_overrides( in PolicyList policies, in SetOverrideTypeset_add ) raises (InvalidPolicies);It returns a new Object, which has the new set of policies. Use this objectfor all the invocations for the new policies to be effective.The set_policy_overrides at ORB level does not return anything.Comming to this issue...The _non_existent() method contacts the server to actually determine if theobject exists. So its almost like a method invocation and hence any changesto policies will not effect this object after the call to _non_existent().The user is changing policies at ORB level and already invoked an operationon server and hence will not affect the policies of the object reference.To solve this problem you can do any of the following:1) make the call to _non_existent() after setting the policies.2) override the policies at object level and get a new reference and invokeoperation on this new method.CORBA::Object_var o2 = o->set_policy_overrides(policies,CORBA::ADD_OVERRIDE);Bank::AccountManager_var manager = Bank::AccountManager::_narrow(o2);Then the timeout is effective.Since OMG returns a new object for set_policy_overrides(), it is interpretedthat the policies are effective only for new object and not the old one.Instead of determining the policies of object during creation of objectreference, VBC determines the first time a method is invoked.FYI:- I have the test case to show the behaviour.[/Pre]

Old KB# 26536

#VisiBroker
#Security