Extern connection to domino is extremly slow

Hi all,

I'm building an BB-application that makes a connection with a lotus domino server, using CORBA. But when i ask the server for a record from the selected view, then it takes 5 till 10 seconds to get a response (this is the same on a standalone java application on my pc), while there are only 300 records in the view and the view has a full text index.

I've tried it with:

  • getEntryByKey
  • getAllEntriesByKey
  • FTSearch

I was wondering if there are more people here that had those speed issues, and how they solved it.

Trackback URL for this post:

http://blackberry.developercommunity.com/trackback/34

getEntryByKey is usually a fast method to access data, so I wonder if the view might be the problem. Does it take 5-10 seconds every time, or is the first access very slow and then it's faster after that?

Some things you might check are the selection criteria (make sure that @today or another time function isn't used) and the column formulas, particularly for the sorted columns that you are using as a key. I would expect the getEntryByKey method to be much faster than what you describe (FTSearch is much slower and you probably don't want to use that).

Good luck.

RWaters's picture

I agree that the slow point is most likely the view itself, this tends to be the case. Aside from complex formulas in view columns I would double check the view index properties, if something like "discard after each use" is set it will rebuild the index every time you do your lookup and will take forever.

Rich Waters
http://www.rich-waters.com/blog

The index is set on

Refresh: Auto, after first use
Discard: If inactive for 45 days.

The view contains 10 columns that must be loaded in the vector. So i don't understand why it takes so long...

RWaters's picture

Looking at your code it seems like you are only actually using one of the columns in the view? (column 4) Are there a lot of computed columns with @formulas? perhaps making a new view with just the needed column?

Rich Waters
http://www.rich-waters.com/blog

there are plenty of computed columns, but it is an existing system wherefore only a standalone application must be created. So i can't change the view.

I think i can make a workaround by filling an vector for each file/row in the view, and then start searching/selecting on the vector. So I only need to access the domino database once each session.

Have you tried opening the view just in a browser to see how slowly it loads? If it loads normally, then the only other thing I can think of, which I can't tell from you code, is whether you might be getting the view multiple times. It doesn't look like it from the code, but if there is another loop (or if the code gets called multiple times), it is possible that the getView slows down the process.

I doubt that is it, but I thought I'd mention it. Let us know if the vector works as you hope.

I call this view only once in the entire application, so i'm realy sure that it's not stuck in a infinite loop or something like that.

I've created a class (Node) that contains all the information each file/row contains. By looping through the view i create an array with new Nodes. So after this i have the complete view locally. Now it takes 15 seconds to fill those Nodes, but after that i can call the nodes instead of the Domino View. This performs extremely well, because i use local values instead of those from the server. The application is a little less accurate this way, but i prefere the performance.

Thanks for the command, i just tried it with getAllEntries and i took 12 seconds to show just 54 records (that are all records in the view). Each time i call the method it tooks 12 seconds, not only the first time.

 

ViewEntryCollection dc = view.getAllEntries();
ViewEntry entry = dc.getFirstEntry();
while (entry != null)
{
Vector v = entry.getColumnValues();
list.add(v.get(3).toString());
entry = dc.getNextEntry();
}
list.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
valueChanged();
}
});

This is the code i use, nothing special i gues....

EDIT: I'm thinking about making vectors for each record, so i need to get the information only onces from domino, but will this give me a uge speed burst, or would it take like forever to fill those vectors?

Well well, it took some time but i figured out what the real problem was. I was running my application from eclipse, but eclipse took almost 10 seconds before de application realy started. Even the developer server was extremely slow (to manny stuff on that one). So now i've created a release build where i use the live server, the application is running realy fast. Tnx for all the help with this problem!