the corner office

a blog, by Colin Pretorius

« Newbie | Main | Dear diary »

# Damnandbuggerit

Icky icky icky Notes bug, still not fixed with 5.0.12.

If you have a large view, and are traversing a ViewEntryCollection, the 16128th entry will duplicate, so that entry 16129 is actually the 16128th entry *again*. After that things are off by one, and you'll never actually hit the last entry in the view. This 'off-by-one' error re-occurs for every multiple of 16128, so your 32257th entry will also be wrong, etc.

This is a commonly-known LotusScript bug, but I just found out the hard way that Java is susceptible to this too. Pffeh!

Update: it seems that ViewNavigator isn't plagued by these problems. So that looks like it's a workaround. The only problem with ViewNavigator is that you run into memory leak issues if you don't explicitly recycle() the underlying document. I returned the Document from a class method that encapsulated the ViewNavigator and ViewEntry (I'm a big fan of writing my own iterators), and despite explicitly recycling that, I still had to add

entry.getDocument().recycle();

to the code to swat that document. That doesn't make sense, but at 3h30 in the morning, I'm not going to complain. Thank heavens for notes.net!

File under: notes/domino : {2004.01.21 02:24}

Comments:

1. Ben Poole (2004.01.21 - 10:06) #

Lawks! Actually, NotesViewEntryCollection is such a grim class: there have been lots of bugs with it in R5, to the extent that I do most things with a view nav.

It's interesting that both Java and LS are affected: this would point to a bug in the core C++ wouldn't it, seeing as the LS and Java classes are just wrappers around Notes' functionality?

Or do I mean C? I can't remember which Notes is written in... ;-)

2. Colin (2004.01.21 - 10:40) #

I must be honest that I've never considered there to be great differences between a ViewEntryCollection and a ViewNavigator, so I'm rather foxed at the fact that one works and the other doesn't. It all seems too easy. I'm waiting for something to rear its ugly head.

The ViewEntryCollection, by the looks of things, is a C++ 'wrapper' written purely for LS and Java, 'cause you can't get to it via the C++ API - you traverse ViewEntries using a standard LNViewFolder, and if you do that you don't run into this 16k problem. All very tricksy.

3. jonvon (2004.03.10 - 16:13) #

i saw a demo one time where a guy showed a bunch of different functions that traversed views. he was cycling through a collection of 5,000 docs (his email inbox). view navigator was the fastest. he said it was like a "cursor" going over the view. i am not too sure what that means in terms of what is happening under the covers, but i got this picture in my mind of one of those old dumb terminals and hitting the arrow key to watch the cursor fly over the fields onscreen.

i too have gone almost exclusively to view navigators where i can. they rock.

Add a comment

Your name (mandatory):

Your email:
Your email address is not displayed
Your home page:

Comment (sorry, no HTML):

Remember details?
Yes No

meta

-home-
about
contact
disclaimer
articles
code
link blog

style: [?]
[plain.dark.blue]

Categories

java
linux
music
notes/domino
personal
politiek
studies
techie
thee_blog
world

RSS Feeds

rssfeed all posts
rssfeed all cmts
rssfeed tech posts
rssfeed tech cmts

Archives

2008.11
2008.10
2008.09
2008.08
2008.07
2008.06
2008.05
2008.04
2008.03
2008.02
2008.01
2007.12
2007.11
2007.10
2007.09
2007.08
2007.07
2007.06
2007.05
2007.04
2007.03
2007.02
2007.01
2006.12
2006.11
2006.10
2006.09
2006.08
2006.07
2006.06
2006.05
2006.04
2006.03
2006.02
2006.01
2005.12
2005.11
2005.10
2005.09
2005.08
2005.07
2005.06
2005.05
2005.04
2005.03
2005.02
2005.01
2004.12
2004.11
2004.10
2004.09
2004.08
2004.07
2004.06
2004.05
2004.04
2004.03
2004.02
2004.01
2003.12
2003.11
2003.10
2003.09
2003.08
2003.07
2003.06

© Colin Pretorius