Notes SDK very slow returning calendar entries

Using the Notes C++ SDK, it takes almost four minutes to retrieve the calendar entries.  I may have a slow connection, but the Notes client doesn't take even close to that long.

I am using the code from the schedule sample as such:

   LNNotesSession session;
   session.Init();
   LNCalendar calendar;
   session.GetCalendar(&calendar);
   LNDatetime beginDate;
   LNDatetime endDate;
   beginDate.SetDate(3, 29, 2010);
   endDate.SetDate(3, 30, 2010);
   LNDatetimeRange range;
   range.SetBegin(beginDate);
   range.SetEnd(endDate);
   this->calendarEntries = new LNCalendarEntryArray();
   calendar->GetEntries(range, calendarEntries);

Stepping through, it is the call to calendar->GetEntries that is slow as molasses.  It takes almost four minutes to return.
jlalandeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cupCommented:
If you use GetEntry does it take just as long?
0
Sjef BosmanGroupware ConsultantCommented:
I found a different example:

LNCalendar           calendar;
LNDatetimeRange      range;
LNDatetime           dt("10/19/98 08:30 AM");
LNDatetimes          dts;
LNCalendarEntry      entry;
LNCalendarEntryArray entries;

...

range.SetBegin("10/19/98 10:00 AM");
range.SetEnd("10/19/98 05:00 PM");
dts.Append(dt); // single date/times must precede ranges
dts.Append(range);
Session.GetCalendar(&calendar, "myserver", "jsmith.nsf", "John Smith");
calendar.Open();
calendar.GetEntries(dts, &entries);
entry = entries[0];

...

See http://www-12.lotus.com/ldd/doc/tools/cplus/3.0/lncpp30.nsf/078c27b23262ffff852566dd0029426a/610c313d42824d6185256e820053236b?OpenDocument
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
trinitrotolueneDirector - Software EngineeringCommented:
rather than retrieving a range I would suggest retrieving just one entry and then repeating this process in a loop.
see code snippet below. this is just an indication of the approach you can take. I'm not sure of the actual API to be used. for eg. you might want to see how to increment curdate
LNCalendar calendar;
 session.GetCalendar(&calendar);
 LNDatetime beginDate;
   LNDatetime endDate;
   beginDate.SetDate(3, 29, 2010);
   endDate.SetDate(3, 30, 2010);

while(curdate < endDate) //curdate is a running variable to keep track of the date values
{
   //LNDatetimeRange range;
   //range.SetBegin(beginDate);
   //range.SetEnd(endDate);
   //this->calendarEntries = new LNCalendarEntryArray();
   calendar->GetEntry(calendarEntry);
   vector<LNCalendarEntry> v1(100);
   v1.push_back(calendarEntry);
   curdate++;  //increment curdate by 1
}

Open in new window

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

cupCommented:
Think you'll have to retrieve them one minute at a time rather than one day at a time.  Basically loop round 1440 times for each minute of the day.  That is, if GetEntry is fast enough.
0
mbonaciCommented:
Is it possible that you're sending date range in the wrong format?
0
jlalandeAuthor Commented:
cup: GetEntry is just as slow.

sjef: I updated to use the sample you provided but still no love.

trinitro: Unfortunately, with GetEntry so slow, looping isn't very good either.

mbonaci:  I have inspected the LNDatetime objects and they appear to be correct.

Thanks for all of the suggestions!
0
cupCommented:
Try setting the time on the begindate and enddate.
0
cupCommented:
I don't know a lot about Lotus: can this be accessed through ODBC?  Do you know what the calendar table is called?
0
jlalandeAuthor Commented:
sjef, I am looking at the sample you sent and I am wondering where the GetCalendar argument "jsmith.nsf" comes from.  Is that a local file or a file on the Domino server?  Do you know?
0
Sjef BosmanGroupware ConsultantCommented:
LNSTATUS GetCalendar(LNCalendar *calendar, const LNString &server = "", const LNString &dbname="", const LNString &ownername="")

The 2nd parameter is the name of the server, e.g. "yourserver/ACME", or "" for a local database, and "nsmith.nsf" is the user's mail/calendar database.
0
jlalandeAuthor Commented:
Since this solution provided not only a sample, but a link that explained things that the SDK-included documentation did not, namely that a database must be opened before retrieving items, this solution comes closest to resolving my issues.

I have more questions, but I will take them up in another EE question.
0
Sjef BosmanGroupware ConsultantCommented:
Thanks!

Sjef :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.