jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Database connections & queries
Date Mon, 27 Aug 2007 10:13:18 GMT
Hi,

On 8/27/07, Thomas Mueller <thomas.tom.mueller@gmail.com> wrote:
> > We could change the behaviour of the iterator to throw a NoSuchElementException.
> > That's an exception already declared on nextNode().
>
> What about a new JackrabbitRuntimeException? NoSuchElementException is
> a RuntimeException as well. NoSuchElementException means "the
> iteration has no more elements", and is thrown if next() was called
> too many times. I prefer fewer exception classes, but in this case
> reusing NoSuchElementException doesn't feel right (to me), because the
> same exception is thrown for a common user error (not calling or
> ignoring hasNext()), and internal problems like dropped connections.

+1 Using NoSuchElementException would make it difficult for a client
to determine the real cause of the failure.

This is actually something we may want to take up in JSR 283, perhaps
even going as far as adding a RepositoryException to nextNode()...

BR,

Jukka Zitting

Mime
View raw message