Home > Ask the Domino Experts > Domino Development Questions & Answers > How can I simulate an LSSession outside LEI?
Ask The Domino Expert: Questions & Answers
EMAIL THIS

How can I simulate an LSSession outside LEI?

Andre Guirard EXPERT RESPONSE FROM: Andre Guirard

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 10 March 2004
We are going to migrate from NotesPump 2.5 to LEI 6.5, and we have some huge problems. Our replication activities are run outside the Pump administrator. We have seven databases that run schedule agents to perform the replication activities. We used NPActivity class in Pump, and we migrated to LEI 3.x with no problem replacing the class with LCSession class. However, as you know, this class is not supported in LEI 6.5 in our context. We have over 30 agents to migrate, and it's too expensive and time-consuming to do them all over again. How can I simulate an LSSession (with the activity name as a parameter) outside the LEI environment?

Any help would be appreciated.


>
I'm going to review some things you already know for the benefit of other readers. You have scheduled agents from LEI 3 that contain the statement Uselsx "*lsxlei". With 6.0 and later, the lsxlei library is not available, and you must change these to Uselsx "*lsxlc".

The lsxlc library contains the same functionality as the old lsxlei; they have been merged in LEI 6. However, some functionality is only available when your agent is run by a "scripted activity." Specifically, scripted activities can write to the LEI log and can initialize an LCConnection with data from an LEI "connection" document (so that you do not need to hardcode the database name, userID, password and other details). Scheduled agents and other code not executed by an LEI scripted activity may not use these functions. For example, in a scripted activity you could write:

Dim lcses As New LCSession
("Name you make up") 
Dim lccon As New LCConnection
("LEI connection document")
(where LEI connection document is the name you selected for a connection document in the LEI database. Since the connection document contains the database name, userID and password, you don't need any other information to connect to the database. However, when not in a scripted activity, you cannot use a connection document; instead you must use the name of a connector such as "db2." So in your scheduled agent you might write:
Dim lcses As New LCSession 
Dim lccon As New LCConnection
("db2") ' or other connector name... 
lccon.Database = "CUSTTRAK" 
lccon.Userid = "Miguel" 
lccon.Password = "hola!" 
Since your problem involves scheduled agents, you can solve the problem quite easily. Disable the agents' schedules, and use the LEI Administration console to create Scripted Activities that run the agents on schedule instead. Then your existing code should work exactly "as is."

If you don't want to use scripted activities to run the agents, LEI version 6.5.1 supports initializing connections either from a connection document, or with a connector even when you are not in a scripted activity. If you can upgrade to 6.5.1, you don't need to hardcode connection information; however, logging functions are still only available if you're running a scripted activity.

If upgrading is not an option, go to the LEI Redbook online and click the "Additional Material" link. The downloadable sample database that accompanies the Redbook contains a script library names DECSDatabase, which you can use to initialize a connection from a connection document.

By the way, since you describe these as "replication" agents, have you considered trying to replace them entirely with LEI Replication activities? That'll probably run faster than your script since it's implemented in C.

Do you have comments on this Ask the Expert Q&A? Let us know.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Domino Development
Can I create and copy Microsoft Excel spreadsheets with LotusScript?
'Illegal circular use: Audit Trail' error when opening Lotus Notes docs
How to make computed fields recalculate
Sending and logging faxes from Lotus Notes and Domino
Accessing documents in a Lotus Notes database
Adding an action to the Lotus Notes right-click menu
Writing temporary text files that email as attachments
Trapping the on-click event of a radio button
Copying a form object using LotusScript
Connecting to a remote DB2 server with LEI

LEI and DECS for Lotus Notes Domino
Top 10 Lotus Notes Domino programming and development tips of 2007
An introduction to Lotus Enterprise Integrator (LEI)
A smorgasbord of Notes/Domino development tips
DECS and DCR external data access considerations
Importing data once from Oracle app into Notes app
Moving data (text) from Lotus database to Oracle
Restricted in connecting LEI to Notes databases?
Lotus Enterprise Integrator (LEI)
Integrate Domino 7 beta with DB2
Automated export of selected public NAB information

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts