|
|
|
|
|
|
|
|
|
|
|
|
|
|
BASIC SERVER TASKS
Coding Domino server tasks in C: the adventure continues
By Ian Cherrill
If you made it through last month's article on using Microsoft Visual C++ 6.0 to write Domino server programs (at http://www.dominopower.com/issues/issue200012/coding001.html), you're probably wondering how to apply this newfound knowledge to a program that does something useful. Well, that's the aim of this article.
I mentioned last time some of the reasons you might want to write a C server task. Since we're going to write a useful program this time rather than compile an example, here's more detail on the reasons you should consider using C server tasks instead of the alternatives, such as a LotusScript or Java scheduled agent.
For one thing, C server tasks always run in an unrestricted mode. You can access the file system of the server, run other programs, and interact with other systems. Unlike Notes agents, you can access Notes databases on other servers too. So there's more things you can do with a C server task than an agent.
"This month I had to write a program to archive 20,000 documents a night from a 450,000 document, 3GB Notes R4.6 database."
|
C server tasks are the best for performance. This month I had to write a program to archive 20,000 documents a night from a 450,000 document, 3GB Notes Release 4.6 database. The original LotusScript agent failed first because of a signing issue--the new server it ran on didn't allow the signer to run agents on the server. Then it failed because the script didn't handle some errors very well (what is that On Error Resume thing?), and finally it failed because it ran out of its allotted time on the server (it was taking hours to complete), though I have to say the server didn't help as it was an R4.62 machine. I had no such problems with the same task in C, and it ran in half the time even with full logging-per-document turned on. C is simply the best way to make an agent run in a performance-challenged server environment.
C server tasks are not as difficult to write as you might think. The archiving program I mentioned above was written and tested in one afternoon. Once you're used to the debugging environment and you have a library of useful routines (getting each document in a view, listing all the databases on a server, and logging a Notes error are good ones), putting together a server task is not difficult or time-consuming. You certainly have to invest more of your time at the start of the learning curve, but the rewards are there when you're up to speed.
This month, we're going to look at a program my company supplies for free called ACLHelp. ACLHelp is a simple server task that allows you to become manger of a database by using the Domino remote console. This is very useful if you've just dropped yourself out of an ACL (Access Control List) by pressing the wrong button (having a bad day?) or if one of those dear users has deleted everyone including themselves and you out of the ACL of their mail file and now wants to know what you're going to do about it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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. |
|
|
|
|
|
|
|
|
|
|