Issue 4059: When to honor the servant delegate in POA? (java-rtf) Source: Borland Software Corporation (Mr. Vishy Kasar, nobody) Nature: Uncategorized Issue Severity: Summary: Java language mapping gives the user ability to set the delegate on a servant through: abstract public class Servant { public void _set_delegate(org.omg.PortableServer.portable.Delegate delegate) { _delegate = delegate; } } POA implementation must also set this delegate in many instances where user provides POA with a servant. activate_object, set_servant etc. In normal cases user does not set any delegate of his own. In special cases user may set his delegate on a servant before passing the servant to POA. There are also cases where user written servant manager may return the same servant over and over again. It is unclear from the language spec if POA is supposed to honor the already set delegate or set its own Delegate no matter what. It seems beneficial to me to look at the existing servant to see if this already has a Delegate and set it only if it has none. Comments? If that is a good idea shall we change the language spec to state that explicitly? If we do not state this explicitly, user code may behave differently when moved from one ORB implementation to the other. Resolution: see above Revised Text: Actions taken: November 17, 2000: received issue May 13, 2002: closed issue Discussion: No change is really needed here, since the spec indicates when the delegate should be set (see 1.20.2.2). It is also stated that a Servant can only be associated with one ORB at a time. So, the clear interpretation is that the explicit set of operations sets the Servant delegate, regardless of how it is set. Close no change. End of Annotations:===== Sender: "Vishy Kasar" Message-ID: <3A15BDD3.5690A2F3@inprise.com> Date: Fri, 17 Nov 2000 15:22:59 -0800 From: Vishy Kasar Organization: Inprise Corporation - Visibroker Development X-Mailer: Mozilla 4.5 [en] (X11; I; SunOS 5.6 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: orb_revision@omg.org, java-rtf@omg.org, vishy , mleland@fpk.hp.com Subject: When to honor the servant delegate in POA? Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: m"]!!PN\!!VCXd922pd9 This is an issue with POA implementation in Java. Java language mapping gives the user ability to set the delegate on a servant through: abstract public class Servant { public void _set_delegate(org.omg.PortableServer.portable.Delegate delegate) { _delegate = delegate; } } POA implementation must also set this delegate in many instances where user provides POA with a servant. activate_object, set_servant etc. In normal cases user does not set any delegate of his own. In special cases user may set his delegate on a servant before passing the servant to POA. There are also cases where user written servant manager may return the same servant over and over again. It is unclear from the language spec if POA is supposed to honor the already set delegate or set its own Delegate no matter what. It seems beneficial to me to look at the existing servant to see if this already has a Delegate and set it only if it has none. Comments? If that is a good idea shall we change the language spec to state that explicitly? If we do not state this explicitly, user code may behave differently when moved from one ORB implementation to the other. -- Cheers! Date: Thu, 20 Dec 2001 16:14:33 -0800 From: Vijaykumar Natarajan Subject: RE: Vote 3 is now open In-reply-to: <200112131809.fBDI9B716697@ha1sca-mail1.SFBay.Sun.COM> To: "'Ken Cavanaugh'" , java-rtf@omg.org Cc: Cuie Zhao Reply-to: vnatarajan@borland.com Message-id: <001001c189b4$779952a0$c35a14ac@VIJAY1> Organization: Borland Software Corporation MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Mailer: Microsoft Outlook, Build 10.0.3311 Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Content-Type: text/plain; charset=us-ascii X-UIDL: >QLe9R$M!!+YS!!-pLd9 Borland votes as follows: 2979 YES 3204 YES 3320 YES 4009 YES 4059 NO: > No change is really needed here, since the spec indicates when the delegate should be set (see 1.20.2.2). I don't see where the spec says when this should be set. All the spec says is that one cannot invoke methods on a servant before setting the delegate. > It is also stated that a Servant can only be associated with one ORB at a time. The comment in the issue was w/ respect to portable behavior, and not simultaneous runtime association w/ two ORBs. The issue is easily seen in this example: Say the POA uses a servant_locator. When the ORB gets a servant back from a call to preinvoke, it has to set the delegate every time. This is because it cannot check whether a delegate has been set, as that will result in an exception when delegate is not set, and would be a performance issue. Therefore when the same servant instance is returned for two consecutive calls, the delegates may end up getting overriden while the first request is still running. This means if I have a long running invocation, the delegate gets swapped underneath during the duration of the call, which could result in different behavior in different ORBs. By requiring that the delegate be set only once, this "race" condition gets eliminated. 4064 YES 4158 YES 4271 YES 4286 YES Thanks, Vijay > -----Original Message----- > From: Ken Cavanaugh [mailto:Ken.Cavanaugh@Sun.COM] > Sent: Thursday, December 13, 2001 10:09 AM > To: java-rtf@omg.org > Subject: Vote 3 is now open > > > Juergen has posted the writeup for vote 3 at > > http://cgi.omg.org/pub/javartf/Vote3.htm > > Votes are due by 5 pm PST on December 20, 2001. > > Thanks, > > Ken. > >