Dreaded @DbLookup fouls me up again

I have spent two days trying to figure out when I changed the data in a form and then saved it to a document it didn’t change in the form.I had attributed this to the fact that somehow a document was being loaded when the form was called thus presenting incorrect data. After removing every document in the view and calling the form and still seeing incorrect data appear I finally figured there was some wierd cache at work here.

Well, finally after searching for a few hours I ended up on the @DbLookup, that dreaded command that keeps the whole page from loading, and noticed that if not commanded to do anything it has a cache: how stupid is that? Don’t the people that design this program know better or what?

At any rate I post this here, call me unobservant if you want, in the hope it saves some other app designer a few hours.

Note to Notes Database Designers: In version 9 please turn the caches “off” unless user specifies “on”.

Cheers, Im gonna have some Beers,

                 Steve

Subject: Dreaded @DbLookup fouls me up again

Subject: Help, I need some Help

Thanks for kudos; however, after a couple of years of trying to get answers from help I found coming up here was a lot more useful! So there may be one or two. Who knows? Cheers,

        Steve

Subject: Dreaded @DbLookup fouls me up again

Hmmm…

Change the default behavior of a function that has been caching data this way for the last 15 years? Make a huge number of working programs that have been written in the last 15 years suddenly work much slower?

All because you didn’t read the documentation?!

Maybe that’s a bit harsh, and I’m sorry you had a bad experience… but that’s a really, really, bad idea.

Subject: Thanks for comment

Please don’t be upset with me, but I disagree vehemently that it is a bad idea. I think it is a great idea. It is hard for me to imagine that the great majority of notes programs would be adversly affected to the degree which you suggest. Since turning off the caches I notice no degredation in page load time whatsoever. Actually I read all about @DbLookup. As a matter of fact I have a printout of what help says in the one of the program notebooks, under formula language. And, Yes, I missed what it was saying about the Cache, even though it is in bold print. Which is suggestive that I am not the only one that has been bitten by this.

So, this may sound a little harsh, but you are full of crap if you say I don’t read the documentation.

     Cheers,

            Steve

Subject: You may well read the documentation, but…

Changing a very integral and basic function that has been a certain way for years is very risky business. Perhaps the documentation needs to be more clear, but this would break many applications for a fairly dubious gain. There is caching all over the place in Lotus Notes, and it is occasionally annoying, but usually a huge performance enhancement.

The one part of your post that makes me wonder about your experience as a developer is “Since turning off the caches I notice no degredation in page load time whatsoever.” You were not running this on a database with 100,000 documents, were you. Or one used by hundreds of people simultaneously. Performance hits don’t usually show up on small scale test databases, they show up in large scale, heavily used databases in production. Search these forums and you will find numerous cases of people with 100 second load times on a form who changed their @DbLookups to remove the “NoCache” and suddenly saw <1 second load times. Will it happen for every use? Of course not, but that is the part that makes me wonderat your level of experience. Oh, that and being rude to someone you don’t know in a forum you may need to depend on for answers. Both are usually signs of inexperience.

So, welcome to the forum, but try to maintain some sense of decorum in here. People are very helpful, but can get touchy if you assume you know infinitely more than they do. In this case, the documentation said something and you missed it. No big deal, it happens to all of us, but then don’t get mad when people suggest you read the documentation. I’ve been doing Notes development for over twelve years, and people still often point out things I have missed, or assume are one way when they are not, or are not any longer. I just take it in stride, and try to thank them for helping me out. Then, next time I ask for help, they are likely to want to do so again.

Subject: Thanks for your Comments

I am interested in whom you think I was rude to and why? I am keenly aware that if you cache a huge file the load time, at least on relaod, will be significantly improved. My situation is not so critical so I am not as sensitive to reload times as others seem to be. And I am not suggesting that the Cache feature be eliminated just that the default case is Cache off, not on. Why do you think Lotus decided to put the cache on in the first place?

The issue that was created, in my case, by the cache was an intermittant one and the app was well into the testing phase before it was noticed at all. I wonder how many times users using these apps with all these caches are unknowingly viewing non-current data because they are viewing pages that are cached? This could lead to serious consequences where as a slow page load is just an inconvenience.

By the way you are going to Love Ver 8. One of the posts on here indicated that none of her forms work on submission because the provider “upgraded” their servers to 8. She said that the @Command(FileSave) needs to be replaced by script So much for legacy.

            Cheers,

                 Steve

Subject: RE: Thanks for your Comments

There are times it is safe to change a default, and times it is not. For example, at some point, IBM added the ability to set Option Declare automatically whereas it had not before. That was a good move. If there ALWAYS had to be a parameter, so

@DbLookup(“”:“Cache”; …)

had to be specified, IBM could safely change the default, because every specific formula would still work the way it had before. But when a default is implied, it is much more dangerous. There are applications that have been used for years with very few changes, or with parts of the application unchanged. I have sample databases that were created in the 1990s that are still used by people, and there are certainly production apps like that as well.

So if you change a default that is implied, those applications could slow down under Version 9, with no real explanation. In some companies, there would not even be an experienced developer there to fix the problem, since the original database was farmed out to a consultant. The design of a database might even be locked down because it came from a third party commercial product.

But no matter where it came from or when it was last modified, it would now work differently. Not even just more slowly, but differently. There are times I have used the caching on purpose because I wanted to change a value and I DIDN’T wnat the new value used. But since I never coded the caching in explicitly, the application would now break.

That is why you don’t change defaults easily. And @Command([FileSave]) certainly still works in Notes 8. I am not sure why the other poster thinks differently, but IBM takes backwards compatibility very, very seriously. They aren’t perfect, things do change or break, but it would either be a big decision or an urgent bug to fix.

(And I thought you were rude to Richard)

Subject: RE: Thanks for your Comments

Good information! I am sure you are aware if you put in @DbLookup(“”;“”;“view”;“firstcol”;“getme”) the command works fine with the cache on. So far I have not seen a case where the cache would be off if one puts in the double quotes. I have some apps that were modified in 7 that don’t run on my OS/2 machines under 5.0.9. As far as I know there are no 7 specific codes in them. I agree with you that legecy is a nice thing. And I think it is a non-sequiter to worry about “sealed, locked” applications that were created in 5, 6 or 7 not running on a new server. Just keep an older server around to run those. So what do you think of Uncle Bill, Gee everytime windows comes out with a new version half the apps don’t work very well if at all. And isn’t IBM smart enough to figure out a way to update @DbLookup so that it would say, ok this is Ver 6 so I will turn on the Cache as default or oops this is ver 9 app default cache must be off?

But this has always been IBMs issue. Cater to the experts and let the novices suffer. I am convinced that is the main reason OS/2 failed. It is a far superior OS to the windows at the time, maybe even now. But getting it running is a giant pain in the a… oops I better watch what I say or the moralists will be out of joint. I mean it was a terribly difficult and frustrating OS to get working.

Thanks for your opinion on my treatment I will take it under advisement.

         Cheers, 

             Steve

Subject: RE: Thanks for comment

I’m not upset with you. I have no problem with you disagreeing with me at all. Vehemently, even.

And, ok… You did read the documentation. You just didn’t fully understand and retain it. That’s no sin. I guarantee that even after 14+ years, there are still documented features in Notes and Domino that I have read about but don’t fully understand or retain.

That’s still no reason to change the way @DbLookup works with default arguments.

You say it’s “hard to imagine” that the great majority of Notes programs would be adversely affected? Where did I say anything about the “great majority”? What I said was “a huge number”. It can still be a minority of Notes apps, yet be a huge number, because the total is bigger than huge. And maybe I was indulging in a bit of hyperbole there, and with “much slower”, too. For that, I may be, as you say, “full of crap”. I still believe, however, that I’m right.

You didn’t notice any degradation in your app? That’s nice, but I’ve personally worked on or with many apps that absolutely do degrade severely when “NoCache” is used for lookups. As Ben has said, there are plenty of documented cases. If caching weren’t important, this IBM RedBook probably wouldn’t have mentioned it http://www.redbooks.ibm.com/abstracts/sg245602.html (see page 56). And though that particular RedBook was published only 7 years ago, I’m sure that that particular point was also included in performance whitepapers that Lotus published in the mid 90’s.

Out of tens of thousands of organizations using Notes applications, can you imagine that there are five apps such out there that are used by 100,000 people per day? Can you imagine that there are fifty such apps used by 10,000 people per day? Can you imagine that there are 500 such apps that are used by 1,000 per day. Or can you imagine some other combination of similar numbers? Those are modest numbers, not huge – but I, and I’m sure many others here, can easily imagine that numbers like that are well within reason, and in fact are probably a considerable underestimate of the scope of applications that would be affected. Put all three of those numbers together, and it accounts for 1.5 million Notes users working with such apps, and that’s what?.. less than 2% of the user base.

There’s a very old adage in our business that computer time is cheaper than programmer time, and this is absolutely true. Programmer time, however is far cheaper than user time. (It had better be, or we’d all be out of jobs.) This is what the people who decided what the default behavior of @DbLookup should be had in mind. The common consensus is that those folks were pretty smart, and having met a few of them I have to agree. (Though it’s really too bad they didn’t come up with “ReCache” until Notes 6. If you do start to notice the impact of “NoCache” in any of your apps, you may want to look into the benefits of using “ReCache” to allow your apps to get the advantage of caching while still avoiding stale data in cases where you know for sure that something has changed.)

Anyhow, let’s ignore the apps – huge number, or small – that are severely impacted. Those will be fixed, or discarded. There will be cost in doing that, but let’s agree to ignore that. Let’s just look at apps that will be slightly impacted… a tiny bit slower on each operation, instead of the “much slower” that I stated. Apps where you might not easily notice the impact, although it is real.

Let’s just say that changing the default behavior of @DbLookup slowed down a modest (not huge!) number of apps enough to cost each user an average of 1 second per day. For the numbers I suggested above (five used by 100,000 people, fifty by 10,000 people, 500 by 1,000 people), that works out to 52 person-work-days (8 hour days) lost every single day, or 13,000 person-work-days lost every single year. And remember, we’re ignoring the apps that are severely impacted, and we’re considering only a modest number of apps overall, so I think think a real estimate of the lost time is considerably greateer than 13,000 person-work-days.

But let’s just go with that number, and see where it balances out. Let’s imagine that a Notes developer’s time costs not just twice, but five times the average cost of an end-user’s time. If that were the case, then to balance out those 13,000 person-work-days, it would take 1300 Notes developers losing two work days per year. If I believed that 1300 Notes/Domino developers were losing two work days every year because they didn’t understand and retain the information in the Domino documentation about the “NoCache” option, I’d have to consider agreeing with you. I just don’t believe that that’s the case. And even if it were the case, I don’t believe that changing the behavior of @DbLookup for default arguments would be the best way to fix it.

There is, by the way, a method that IBM could use to change the way @DbLookup works with default args without having any effect at all on most existing apps. They could define a new token for @DbLookup and redefine the old token to @V8DbLookup, similar to the way they’ve redefined a small number of @Functions in the past. This would still have an impact on a small number of apps – ones that dynamically generate and execute @Function code. Since Notes actually accounts for that by disabling caching when @DbLookup is used within @Evaluate, this probably only impacts a very tiny fraction of apps, but those apps will mostly tend to be the largest, most complex, and most performance-intensive apps of all the hundreds of thousands of apps out there. And, much more importantly, doing this would introduce something that we all would have to struggle with regardless of whether we have performance issues: a new and potentially very large class of apps that, because they were written and compiled with a version 9 (or above) Domino Designer, would not work on Notes 8 or below. So even this way, on the whole I think it would be a bad idea.

Now, if you still can’t imagine any of this, and you still disagree vehemently… that’s fine. If you still think I’m full of crap, and continue to do so, that’s also fine. I’m pretty confident that my reputation will survive your assessment.

Subject: Clarification

Here is an allegation that you made in your first post: " All because you didn’t read the documentation?!" This allegation in unfair, unresearched and untrue. I consider it an insult, as would anyone. That is the only thing the “full of crap” was referencing. Here is the entire sentence: So, this may sound a little harsh, but you are full of crap if you say I don’t read the documentation. But just to make it perfectly clear this was only in reference to your allegation and not to anything else that you said. It really amazes me that all I am trying to do is point out a stupid mistake that I made and suggest that in future they turn off a cache and I am catching all this flak. Geeze.

I have been told I must be inexperienced:

    OK,    35 years of programming in the following languages Fortran, Basic, Hpl, Unix, C, C++, Java, Perl, JavaScript,  Ada and several others that I have forgotten.   I have 8 years with Notes, mainly on the admin side.  I put up my first website using Notes on an OS/2 Server. At my site I have 2 OS/2 servers, and 2 Suse Linux, all running on various versions of notes.

I have been told I don’t read the documentation

Ok, Before I wrote one line of code I read Using Lotus Notes and Domino R5 by Tamura. I have two shelves of documentation and a file cabinet full of redbooks concerning nothing but Notes and Domino. Including, in my Formula notebook, 5 pages just about the dreaded @DbLookup Command.

   I have two websites, one is completely notes based and the other is about 1/2 way there.  The apps that I write are concerned with creating pages for the websites and containing the websites and automatically doing admin services.  I started converting the webpages about 2 years ago.  So far these sites have never been hacked, have not gone down due to programming errors. Occassionally one of the OS/2 servers goes down because the traffic load overwhelms the one port that goes into, and outof the kernal.

  Why don't some of you guys occassionally put up a big faux-paux that you have made in the past?  Ohhh, maybe none of you make them, sorry no offense intended.  My interest is only advancing the community by  saying "hey guys, here is something stupid I did, watch out for this."     And sayings "Gee, Lotus your program would be better if.....".   In Flying Magazine they have a column "I learned about flying from that." It is strictly about stupid mistakes.

             Cheers,

                   Steve

Subject: RE: Clarification

I don’t know why I bother, but…

Both Richard and I have mentioned that there are times we don’t know what the documentation says or exactly how a function/method works. Common sense is partly knowing when not to make a lot of bluster after you make a mistake, no matter how understandable, and to accept that we all do make such mistakes. And I have made huge public mistakes before, long before OS/2 was invented for that matter, and in OS/2 and I still make them today. Such is life.

Subject: re: Clarification

First of all, I sincerely hope that absolutely none of what I have said in this thread will be construed by anyone to imply that I disrespect, disagree with, or disbelieve your statement that your "interest is only advancing the community by saying “hey guys, here is something stupid I did, watch out for this.” In fact, I applaud that intention.

More importantly, however, I hereby apologize sincerely for any slur, aspersion or other derogation upon your character or conduct, whether perceived or actual, which may have been created by my use of the phrase “All because you didn’t read the documentation?!”, or by any other phrase that I may have used in my initial post in this thread or my previous follow up.

I personally rescind, and encourage all who read this to recognize that I have rescinded, any such negative implications or inferences regarding yourself that were created by my statements in this thread.

I also apologize in advance for any perception or misperception of the style, tone or content of this post, which I freely admit is written in an overly formal manner, and which could possibly be taken as condescension; but I state for the record that it is in fact written this way with the intention of illustrating, in a way that I hope is self-satirical as well as being satirical in general, that sometimes we all take ourselves a little too seriously in these on-line forums.

Returning to the point, I admit wholeheartedly now, as I did previously in my prior post in this thread, that you may have in fact, as per your claim, read the documentation but merely, as per my claim, failed to understand and retain it.

I furthermore clarify that in fact I have no knowledge or evidence that might lead an objective observer to conclude anything more than the fact that what you may have failed to understand and retain is strictly limited to the part of the Domino Designer documentation that describes the caching behavior of @DbLookup with default arguments.

I also further admit that this is but one small fraction of the documentation of that function which you refer to as “the dreaded @DbLookup”.

I also admit that that in turn is itself but one small fraction of the overall documentation of Lotus Notes and Domino.

And in consequence, I state for the record and with utmost specificity that I therefore have no basis whatsoever to conclude or believe that you have not in fact read all, most, or at least many very significant parts of said documentation, and that it was and would be, in your words “unfair” and “unresearched” for me to state otherwise.

I furthermore accept, though I have no basis other than your word, that you have in fact read said documentation, but I state for the record that your word is sufficient on that matter and shall not be questioned by me.

To use other words, which are in fact your words, I am stating for the record that I have “put up a big faux-paux”.

Although in my own words it would be “committed a faux pas”. :wink:

Notwithstanding any of the above, however, I do not in any way rescind, disclaim, or deny my stated belief that your suggestion in your initial post is “a really, really, bad idea”.

Specifically, in my considered opinion, your suggestion that “In version 9 please turn the caches ‘off’ unless user specifies ‘on’”, which I understand that you offered in the spririt of “Gee, Lotus your program would be better if…”, is something which I believe would not, in fact, be better, but rather that it would be worse. I refer you to my prior post for the reasons for that belief.

-rich

P.S. Feel free to read the above post in John Cleese’s voice, while recalling the scene in “A Fish Called Wanda” in which he is hanging upside down out a window.

Subject: Apology Accepted and My Apology

Thank you very much for your kind apology and statements. I want to say that I accept it, in full and that, as far as I am concerned, everything is forgiven and forgotten. I want to state to that the above post (your post) shows to me that your generous character and that I appreciate very much the time you spent writing it. I would also, at this point, like to apologize to you for not expressing my self in a less inflammatory manner. I am sure if I had thought about it for five more minutes I could have figured out something that would get the “idea” across without throwing gasoline on the fire. Had I been more discreet all of this hassle, not only between you and me but the others who were reading our posts, could surely have been avoided and we could all have discussed the merits and de-merits of my proposal. For that, I am sincerely sorry, and in future, if I feel offended will try to behave in a more adult manner and leave “bar-room” comments out.

Thank you too for the kind manner in which you corrected my spelling of faux pas.

I also accept the fact that your views on my suggestion for "improving" Notes is a really, really, bad idea. Upon further consideration I have moderated my viewpoint on this somewhat to: " your program would be better, in my humble opinion, if you can figure out a way to make versions written in 9 have the default cache off without affecting previous versions ability to run as intended on servers operating under 9.

In closing, if you see any more of my posts and feel that I am on base or off base I sincerely hope that you will put in your "two cents".

   Cheers,

        Steve

PS was the “a fish called wanda for me?” it only shows up in the response window and not the original one?

Subject: Glad we’re all settled

If you happen to be attending Lotusphere, look me up and we can have a drink and share war stories.

I can certainly agree that if there were a way to change the behavior in such a way that there is no impact on the performance of existing applications that depend on caching, that could be very reasonable idea; but I would also add the provision that new applications should still run correctly on older versions of Notes, so that rules out the “@V8DbLookup” approach and I’m not smart enough to think of any other way of accomplishing it.

As for the Fish Called Wanda postscript, that was just something I added to my post a few minutes after saving. It’s probably just a timing issue. I.e, you opened the intial version of my post, I saved the edited version that added that comment, and then you clicked to respond and the response form pulled in my edited copy.

-rich

Subject: Just because you asked, my faux pas of the day

I already changed the original post, but in the spirit of good will and to confirm what you guessed, we all make the occasional faux pas, even today .

Subject: *Well said

Subject: RE: Thanks for comment

Now that the effect of the 10+ beers you obviously had last night slowly goes away, don’t you feel like apologizing to to Rich?

Subject: RE: Thanks for comment

Nope

Subject: RE: Thanks for comment

Yep.