详细解决方案
27. 在Lotus Notes中缓存视图中的配置数据拔高性能
热度:9653 发布时间:2013-02-26 00:00:00
一个Lotus Notes应用中常常有各种配置数据保存在专门的视图中。由一个关键字和一个值组成的键—值对,是最常见的形式之一。在程序中使用到它们的时候,可以很方便地通过NotesView. GetDocumentByKey之类的方法或者自定义的函数获取。但是在有些情况下,需要频繁地读取这些配置数据很多次。比如在一个代理中需要根据配置文档中的不同币种的汇率,计算上万条文档中的某个金额时。这时为了提高效率就可以提前将币种和汇率读取到内存中,以后用到的时候便可以免去大量的视图查找和读取文档域值的操作。如下面这个函数所示:
%REM Description: Put keys & values from a view into a dictionary%END REMPublic Function CacheKeyValues(viewName As String, keyField As String, valueField As String)As Dictionary Dim dic As New Dictionary Dim s As New NotesSession Dim view As NotesView Set view=s.Currentdatabase.Getview(viewName) Dim doc As NotesDocument Set doc=view.Getfirstdocument() Do Until doc Is Nothing Call dic.Add(doc.Getitemvalue(keyField)(0), doc.Getitemvalue(valueField)(0)) Set doc=view.Getnextdocument(doc) Loop Set CacheKeyValues=dicEnd Function函数的参数中,viewName是从中获取数据的视图名,keyField是保存“键”的字段名,valueField是保存“值”的字段名。返回的Dictionary是在5. 面向对象的LotusScript(一)之Dictionary一文里给出的自定义类,可以通过Contains,Item等方法查询和获取某个关键字的数据。
相关解决方案
- 解析lotus notes 邮箱的nsf文件时怎么绕过身份验证?即不用选择id文件也能对其进行解析
- lotus web开发,截取字符串有关问题
- Lotus Notes软件生手! 求指路
- Struts2 Notes(One)-set up the first sturts2 application
- 黑客攻守技术宝典 - Notes 10 攻击Web服务器
- jQuery in action notes
- window mobile 怎么用程序打开系统ActiveSync, Voice Notes, Camera和office程序
- Android Development Notes -一
- Sharepoint 2013 Crawl Lotus Notes Error解决办法
- 使用 Lotus Connections 跟 Sametime 构建基于 GIS 的个人名片和即时消息应用
- lotus notes 8.5 里组合框comboBox初始值如何设置
- Lotus notes开发的环境搭建有关问题
- notes 有培训机构吗?解决办法
- Lotus domino notes是用什么语言开发的?C?该怎么解决
- Notes @mailsend对象唯其如此1个
- Lotus Notes7.0安装失败(Data1.cab文件损坏),该如何处理
- Lotus Notes软件新手! 求指路!该怎么解决
- lotus 客户端标签有关问题
- lotus sametime8.5哪里有下载?该怎么解决
- Ignoring portion of document that uses a feature from another version of Notes,该如何解决
- lotus B/S 上传 文件解决方法
- lotus domino 6.5 下载解决办法
- 使用C#读取 Lotus Notes 8.5 未读邮件解决方法
- lotus 数据库权限丢失解决办法
- When opened in then notes client?(CS),该怎么处理
- 诸位老鸟们,帮小弟参谋参谋一下!LOTUS NOTES 还是JAVA
- LOTUS 讀取SQL server圖片問題,该怎么解决
- Lotus 迁徙到Exchange POC 之 新建2007 服务器
- Lotus 迁徙到Exchange 2010 POC 之同步忙闲信息设定
- Lotus 迁徙到Exchange 之 Lotus 与Exchange 路由设置