Computewithform performance issue on server dbs -- any suggestions?

Hi

I have a form with some 50-60 fields, of which perhaps half have some sort of simple formulas in them – nothing fancy (i.e. no db lookups etc) but just fiddling with text values from other fields, that sort of stuff.

I have an agent (user activated) that does a computewithform with documents using this form.

If the database is local and the user runs the agent, it’s very fast (almost instantaneous response per document) but for a server based db, the agent is exceptionally slow (5-10 seconds per document).

Tracing the agent’s progress with print statments i found that the delay occurs at the computewithform, and it seems like a lot of communications is taking place between the workstation and the server during the computewithform (based on looking at the communications lightning bolt indicator in the status bar).

It seems that the delay is proportional to the amount of fields on the form, as it doesn’t matter which or how many fields I chop out of the form, the delay changes proportionatly. Chop half the fields out, any half, the delay is about half. Chop them all out and there’s still a delay, but hardly any (but still not as fast as when the db is local).

I don’t understand why computewithform should be affected because a db is on the server because of the size of the form since it’s a local operation taking place only on the computer it’s running on.

Any suggestions??

TIA

Mohib

Subject: Move the agent to the server (and other tips)

Hi Mohib,computewithform has its own virtues. If I understand the mechanism right ComputeWithForm referes back to the cached form on the Notes client when recomputing the fields. Thus you have all this communication going on.

There are several things you might consider:

a) Do you need all field recomputed?

– if no: have a second form that only contains the fields to be computed (use subforms or shared fields to “share” the formulas) and do

trueform = doc.form(0)

doc.form = “formforrecompute”

doc.recomputewithform true, true

doc.form = trueform

b) Check your hide when formulas

Strangewise they are impacting computewithform

c) Try to have the agent run on the server (runonserver command).

Are u based in SE Asia? (me too)

:wink: stw

Subject: Computewithform performance issue on server dbs – any suggestions??

Hi

Thanks for the response.

Your comment about the caching is interesting, but the agent is running on a workstation, so I don’t understand when you say “computewithform refers back to the cached form on the notes client”. How can refering to a cached version on the cient create communication traffic to the server when the computewithform is running on the client? Perhaps you mean it refers back to the cached version on the server??

I tried the option (a) and it doesn’t help much because the delay is still is several seconds, vs almost instant for a local database.

When I tried option a), the new form didn’t have any hidewhen formulas, so that’s not the problem.

I can’t run the agent on the server, because each user needs it to run against some UI work the user is doing and they need the document uptodate.

My only other option is to move all formulas into a lotus script routine which I keep in a library, call that routine in the PostRecalc and also call it wherever I called the computewith form.

This is a bit of a headache because I need to do special work for new documents as the backend document doesn’t exist so I can’t just transplant forumulas which refer to other fields into Evluate functions with the backend document as the context. Similarly I need to do special handling to take care of UI @functions like @IsDocBeingSaved, etc.

Any other solutions to solve why computewithform is slow when the db is on a server??

Mohib

Subject: RE: Computewithform performance issue on server dbs – any suggestions??

Do your field formulas have a lot of @DbLookup or @DbColumn or any other duplicated DB access? Maybe it’s possible to optimize by pulling DB data once in hidden fields at top of form instead of duplicating the lookups in several places. I’m not sure this applies to your case but it’s a thought…

Also, @DbName used to fail with computeWithForm. I’m not sure if it’s fixed yet or not. So make sure your data is fully functioning using that feature.