Issue 3217: Any and UnknownUserException (cxx_revision) Source: Triodia Technologies Pty Ltd (Mr. Michi Henning, michi(at)triodia.com) Nature: Uncategorized Issue Severity: Summary: The mapping requires that it must be possible to insert CORBA::Exception into an any (section 1.19.2). Question: Is it possible to insert UnknownUserException into an Any? If the answer is yes, what are the members of UnknownUserException, what is its CDR representation, and what is its TypeCode? If the answer is no, we should clearly state this and specify what happens if I attempt to insert UnknownUserException into an Any. Resolution: Revised Text: Actions taken: January 13, 2000: received issue Discussion: deferred in June 2011 to the next RTF End of Annotations:===== Date: Thu, 13 Jan 2000 08:01:31 +1000 (EST) From: Michi Henning Reply-To: C++ Revision Task Force To: C++ Revision Task Force cc: issues@omg.org Subject: Any and UnknownUserException Message-ID: Organization: Object Oriented Concepts MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-UIDL: 8Eh!!,^Rd9_B6e9=9`d9 The mapping requires that it must be possible to insert CORBA::Exception into an any (section 1.19.2). Question: Is it possible to insert UnknownUserException into an Any? If the answer is yes, what are the members of UnknownUserException, what is its CDR representation, and what is its TypeCode? If the answer is no, we should clearly state this and specify what happens if I attempt to insert UnknownUserException into an Any. Cheers, Michi. -- Michi Henning +61 7 3891 5744 Object Oriented Concepts +61 4 1118 2700 (mobile) Suite 4, 904 Stanley St +61 7 3891 5009 (fax) East Brisbane 4169 michi@ooc.com.au AUSTRALIA http://www.ooc.com.au/staff/michi-henning.html Sender: jon@corvette.floorboard.com Message-ID: <387D1CA9.22A65BE5@floorboard.com> Date: Wed, 12 Jan 2000 16:30:33 -0800 From: Jonathan Biggar X-Mailer: Mozilla 4.7 [en] (X11; U; SunOS 5.5.1 sun4m) X-Accept-Language: en MIME-Version: 1.0 To: C++ Revision Task Force CC: issues@omg.org Subject: Re: Any and UnknownUserException References: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: G/-!!">/!!]np!!iS&!! Michi Henning wrote: > > The mapping requires that it must be possible to insert > CORBA::Exception > into an any (section 1.19.2). > > Question: Is it possible to insert UnknownUserException into an Any? > > If the answer is yes, what are the members of UnknownUserException, > what > is its CDR representation, and what is its TypeCode? > > If the answer is no, we should clearly state this and specify what > happens > if I attempt to insert UnknownUserException into an Any. Clearly we don't want to allow UnknownUserException to escape the C++ process, since its purpose is to represent another exception. Ideally, inserting an UnknownUserException should result instead in the insertion of the exception that it is representing: CORBA::Any a; CORBA::UknownUserException e; a <<= e; // at this point a should have the same value as e._exc() This would require special case code in the CORBA::Exception inserter to detect and process correctly. -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org Date: Tue, 18 Jan 2000 14:09:38 -0500 From: Marc Laukien Organization: Object Oriented Concepts, Inc. X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Jonathan Biggar CC: C++ Revision Task Force Subject: Re: Any and UnknownUserException References: <387D1CA9.22A65BE5@floorboard.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: ;7kd9^4Xd9g('e9-"W!! Hi Jon, Jonathan Biggar wrote: > > Michi Henning wrote: > > > > The mapping requires that it must be possible to insert > CORBA::Exception > > into an any (section 1.19.2). > > > > Question: Is it possible to insert UnknownUserException into an > Any? > > > > If the answer is yes, what are the members of > UnknownUserException, what > > is its CDR representation, and what is its TypeCode? > > > > If the answer is no, we should clearly state this and specify what > happens > > if I attempt to insert UnknownUserException into an Any. > > Clearly we don't want to allow UnknownUserException to escape the > C++ > process, since its purpose is to represent another exception. > Ideally, > inserting an UnknownUserException should result instead in the > insertion > of the exception that it is representing: > > CORBA::Any a; > CORBA::UknownUserException e; > > a <<= e; > // at this point a should have the same value as e._exc() > > This would require special case code in the CORBA::Exception > inserter to > detect and process correctly. What about this one: CORBA::Any a; CORBA::UnknownUserException* e = ... a <<= e; Would the Any now assume ownership over the inserted UnknownUserException, even though the Any holds e->exception(), and not e? Perhaps we should simply disallow insertion and extraction of UnknownUserException. BTW, why is UnknownUserException a UserException at all? If it were a simple helper class, we wouldn't have this problem. Cheers, Marc -- Marc Laukien Phone: (978) 439 9285 x 245 Object Oriented Concepts, Inc. FAX: (978) 439 9286 44 Manning Rd. WWW: http://www.ooc.com Billerica, MA 01821 E-Mail: mailto:ml@ooc.com Sender: jbiggar@corvette.floorboard.com Message-ID: <3884E833.CF6C5FDA@floorboard.com> Date: Tue, 18 Jan 2000 14:24:51 -0800 From: Jonathan Biggar X-Mailer: Mozilla 4.7 [en] (X11; U; SunOS 5.6 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: Marc Laukien CC: C++ Revision Task Force Subject: Re: Any and UnknownUserException References: <387D1CA9.22A65BE5@floorboard.com> <3884BA72.A0FA082C@ooc.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: Q8Ie9ob>!!PKZ!!7a/e9 Marc Laukien wrote: > What about this one: > > CORBA::Any a; > CORBA::UnknownUserException* e = ... > > a <<= e; > > Would the Any now assume ownership over the inserted > UnknownUserException, even though the Any holds e->exception(), and > not > e? It would copy the contents of the Any and destroy e, which is allowed behavior for any of the Any inserters that assume ownership (to copy and destroy the argument immediately). > Perhaps we should simply disallow insertion and extraction of > UnknownUserException. It's very useful to just take an incoming exception from a DII invocation and turn around an insert it as the resulting exception to a DSI call. If I can't insert an UnknownUserException, then I have to write a lot of special case code to handle this. > BTW, why is UnknownUserException a UserException at all? If it were a > simple helper class, we wouldn't have this problem. Because when using the DII, you access an exception returned from an invocation via Request::env & Environment::exception, which returns a CORBA::Exception *, not an Any. So some subclass of CORBA::Exception needs to be defined to hold the contents of exceptions that are not statically known by the client. -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org Date: Tue, 18 Jan 2000 17:32:24 -0500 From: Marc Laukien Organization: Object Oriented Concepts, Inc. X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: Jonathan Biggar CC: C++ Revision Task Force Subject: Re: Any and UnknownUserException References: <387D1CA9.22A65BE5@floorboard.com> <3884BA72.A0FA082C@ooc.com> <3884E833.CF6C5FDA@floorboard.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-UIDL: [PL!!Ma3!!9QPe9/"^d9 Hi Jon, Jonathan Biggar wrote: > > Marc Laukien wrote: > > > What about this one: > > > > CORBA::Any a; > > CORBA::UnknownUserException* e = ... > > > > a <<= e; > > > > Would the Any now assume ownership over the inserted > > UnknownUserException, even though the Any holds e->exception(), > and not > > e? > > It would copy the contents of the Any and destroy e, which is > allowed > behavior for any of the Any inserters that assume ownership (to copy > and > destroy the argument immediately). Yes, this works. > > > Perhaps we should simply disallow insertion and extraction of > > UnknownUserException. > > It's very useful to just take an incoming exception from a DII > invocation and turn around an insert it as the resulting exception > to a > DSI call. If I can't insert an UnknownUserException, then I have to > write a lot of special case code to handle this. > > > BTW, why is UnknownUserException a UserException at all? If it > were a > > simple helper class, we wouldn't have this problem. > > Because when using the DII, you access an exception returned from an > invocation via Request::env & Environment::exception, which returns > a > CORBA::Exception *, not an Any. So some subclass of > CORBA::Exception > needs to be defined to hold the contents of exceptions that are not > statically known by the client. OK, you convinced me :-) Cheers, Marc -- Marc Laukien Phone: (978) 439 9285 x 245 Object Oriented Concepts, Inc. FAX: (978) 439 9286 44 Manning Rd. WWW: http://www.ooc.com Billerica, MA 01821 E-Mail: mailto:ml@ooc.com