Search DominoPower's 11,433 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
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
2010: A Lotusphere of change
Latest Lotus Headlines
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
How not to crash in LotusScript
IBM Lotus to Google Apps Migration Remorse
Webcast Series: Mobile Collaboration with Lotus Software
Domino Login Control for Mobile Apps
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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 --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login