Search DominoPower's 11,443 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
PROGRAMMING POWER
Cache strategies with @Dblookup, and more
By Mick Moignard

One of the most common examples of less-than-perfect programming I've seen in Notes is the use of @DBLookup or @DBColumn with no thought given to the caching of data -- every call specified with NoCache, because the developer wanted to be sure that data was freshly looked up.

Both of these, @DBColumn in particular, are often used to get keyword data, as well as data from other sources. In development and testing, you may well be changing keyword documents frequently, and feeling some pain by having to exit the application -- including Designer -- each time.

Really though, there's no excuse for using NoCache against rarely-changing keyword fields in production. That's just unnecessary trips back to the server, while the user looks at an hourglass. This practice is especially bad if the form has a lot of refreshes on it, as a refresh will also cause each @DBColumn or @DBLookup with NoCache to go back to the server. Indeed, you can usually see that happening by watching the lightning-bold network activity symbol in the bottom-left corner.

Possibly the ultimate misuse of @DBColumn
I saw what must be close to the ultimate misuse of @DBColumn a few years back. There was a form that had around 150 or so fields on it, where pretty much every one was a dialog/keyword field, with the value list looked up with @DBColumn.

Between them there were about 6 different look-ups in all. And yes, every single one had NoCache specified. You can imagine: composing a new document took several minutes, as each of these look-ups went back to the server for the data.

Once we realised that a somewhat novice developer had built the form, and what the issue was, it didn't take long for that to be fixed -- and of course the compose operation then happened almost instantly.

Here's a tip
Do remember that the first @DBlookup done in any Notes database session -- that's the period between opening a Notes database and closing it again -- will always go and fetch the required data from the server and cache it.

However, that's not to say that every @DBColumn (or indeed @DBLookup) should be specified without NoCache. There may well be application design situations where keyword lists should reflect the latest data. One example might be when a view column is used to drive a keyword list, as is done in the standard Discussion template when selecting Categories. Here, the underlying look-up is to volatile data, so refreshing that list when you do the look-up is the right thing to do.


1  ·  2  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Syncing Notes with Android phones
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by April 10 to save $200.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login