Email:   


Home
In This Issue
Email a Friend
EasyPrint
Click here for the RSS feed's XML code. This is not a browser URL.


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.





[ Next ]

-- Advertisement --

Learn Notes and Domino 7 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away. WebSphere courses are also available!

Click here to try a FREE demo course!!

-- Advertisement --

Shorten your Notes and Domino 8 Learning Curve
Announcing two seminars to save you time with the Notes and Domino 8 Upgrade and help you hit the ground running with all the new development functionality.

Tap into the experience of our real-world experts and get their actionable advice, proven techniques and field-tested solutions to make your job easier.

Learn more and register for limited early-bird discounts at www.nd8upgrade.com (Boston, San Francisco, and Toronto) and www.nd8development.com (Boston and Chicago).

Copyright © 1998-2008, ZATZ Publishing. All rights reserved worldwide.