"Jonathan K. Weedon" wrote:
>
> Dan,
>
> This is not correct. A null is a perfectly valid value in
> CORBA 2.3. I agree that vendors providing IIOP on older
> CORBA implementations may have difficulty with nulls, but
> that is a product issue. Nulls are very much supported in
> RMI-over-IIOP.
You should note that the collection valuetype returned from my finder method
(e.g. ejbFindAll) has to be converted by the container from a collection of
keys to a collection of object references. There is no stated requirement
that we are aware of to handle 'null' when performing this conversion.
I agree that java collections returned by 'ordinary' methods (not finders)
are required to permit null propagation. However since the current spec
'requires' returning an empty (not null) collection from a finder method
to the container, we insist on this to ensure that our customers write
portable finder methods. This is in some ways like the 'narrow' issue.
> -jkw
>
> Dan Christopherson wrote:
> >
> > A null is also liable to cause problems in IIOP based containers
> >
> > On Fri, 16 Feb 2001, Gene Chuang wrote:
> >
> > > Return an empty collection; save the caller the hassle of
> > > NullPointerExceptions!
> > >
> > > Gene
> > >
> > > -----Original Message-----
> > > From: A mailing list for Enterprise JavaBeans development
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of Wong Kok Wai
> > > Sent: Friday, February 16, 2001 2:10 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Null or empty collection
> > >
> > >
> > > The JavaDoc for ObjectNotFoundException put it as:
> > >
> > > <quote>
> > > This exception should not be thrown by
> > > finder methods that return a collection of EJB objects (they should return a
> > > null
> > > collection instead).
> > > </quote>
> > >
> > > Let me rephrase my original question: is there a difference between a null
> > > collection and an empty collection? To me, they mean different things.
> > >
> > > Dan Christopherson wrote:
> > >
> > > > You don't throw ObjectNotFoundException in this case: it's documentation
> > > > just included a red herring on the real issue.
> > > >
> > > > >From the 1.1 spec, section 9.1.9.4:
> > > > "Only single-object finders (see Subsection 9.1.8) should throw this
> > > > exception. Multi-object finders must not throw this exception.
> > > > Multi-object finders should return an empty collection as an indication
> > > > that no matching objects were found."
> > > >
> > > > On Fri, 16 Feb 2001, Tim Endres wrote:
> > > >
> > > > > Maybe I do not understand the question, but if you are throwing an
> > > > > ObjectNotFoundException, isn't the returned value meaningless?
> > > > >
> > > > > tim.
> > > > >
> > > > > > I'm a bit confused what should be returned by finders that return
> > > > > > multiple objects. In the EJB 1.1 specs, it is stated an empty
> > > collection
> > > > > > should be returned. However, in the JavaDocs for
> > > > > > ObjectNotFoundException, it is stated a null collection should be
> > > > > > returned. My understanding is null collection is null, and an empty
> > > > > > collection is a collection with zero elements. So which should I
> > > return
> > > > > > (I prefer the empty collection approach, as it simplifies both the
> > > bean
> > > > > > and client implementations)?
> > > > > >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
________________________________________________________________________________
Evan Ireland Sybase EAServer Engineering [EMAIL PROTECTED]
Wellington, New Zealand +64 4 934-5856
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".