Connecting to external server takes very long

SOLVED

Hello,

I've created an application for Sage 50 using the SDK and I'm having a bit of an issue connecting to our company on a server. If I start a Peachtree session with a local company I created on my machine it works great but when I start a session with our company on the server it takes almost 10 minutes for the initial connection to complete. The same issue occurs when I use the sample code provided by the SDK to connect to our server. Is it normal for a Peachtree session to take this long to start?

Thanks,

Chris

  • 0
    SUGGESTED

    Hey Chris,

    One thing to check... are you doing a ListAccounts() call in the PeachCommunication class? Some portions of our integration make that call, and we had some customers that had absolutely terrible performance (10+ minutes of wait). What had happened at these customers sites was that there was some Sage/Peach bug where one company profile/account had been duplicated literally a thousand times. So looping over the accounts was just absolutely brutal performance wise. Check your returns from that call or output the contents of the list to see what's going on. (The fine folks at Sage wrote a little utility that our mutual customer ran which cleaned up all the duplicate accounts. Worked like a charm.)

  • 0
    SUGGESTED

    Hi Chris, I agree with the suggestions by 'fuerstma'. If these do not resolve the issue, we can investigate further from the Sage support side. But we require a subscription to our Developer Partner Program so we can open a support ticket and escalate the issue to the R&D team if necessary. If you are interested, please send your contact details to [email protected] and we will start the application process. Thanks!

  • 0 in reply to fuerstma

    Hi fuerstma,

    I'm doing a CompanyList("<ServerName>") call in the PeachtreeSession class which is what is taking so long, and i don't have a PeachCommunication class in my API docs, I'm using the .NET API. Sorry for the confusion, but where is PeachCommunication?

    Thanks,

    Chris

  • 0 in reply to Chris Krozel

    Hey good morning Chris,

    So I believe a CompanyList("<ServerName>") call is going to return a CompanyIdentifierList. So even if you ask for a specific ServerName, if the Sage system you're connecting to has been bitten by the aforementioned bug, then that CompanyIdentifierList maybe in fact contain a thousand or more entries of the exact same ServerName.

    So in your code, can you check how big that list is? (Or iterate through it and output the names of the servers and other information in a console/debug stream.) That will let you know if you're actually unexpectedly getting many many copies of the same server entry.

  • 0 in reply to fuerstma

    Hello,

    Thanks for replying!, and I did that yesterday and there doesn't seem to be any duplicates. Outputting the contents of the list results in three companies which is the correct amount (two samples and one non-sample company were opened on the machine). 

    Thanks,

    Chris

  • 0 in reply to Chris Krozel

    Well that's a grade A bummer. Was hoping our past experiences would help out some. I guess at this point I'd follow SoumenS' advice and file a ticket when you can. We've contacted them a few times in the past years and have always been more than satisfied with the speed and thoroughness of the responses.

    Out of curiosity, if you wait the 10 minutes for a connection, are all transactions to that server slow? Like if you query the item list, how long is the wait for that response/list?

    Do you have a Sage 50 client on the machine that is taking 10 minutes to connect to the server? Does the Sage 50 client operate normally, no obvious slowdowns?

  • 0 in reply to fuerstma

    After the initial connection doing the other transactions is reasonable. I do have to query the inventory item list in my app and querying the whole list is slow (about 10,000 items in the list) but using a FilterExpression to get each inventory item one by one and adding it to the list made things fast enough. I'm not sure exactly how long the wait was for the entire list since I did cancel the load to find a better solution with a FilterExpression right away.

    And I do have a sage 50 client that connects very quickly to the company on our server and all other parts of the Sage 50 work well.

    Edit: I said that loading inventory in my Sage 50 client was slow, it's not anymore for some reason and the client seems to be working very well in all places now, not sure what changed.

  • 0

    I started trying to fix this again. This time I used LookupCompanyIdentifier in PeachtreeSession instead CompanyList. LookupCompanyIdentifier works on a test company on my machine but does not work when trying to connect to the company on our server. 

    I get an ArgumentException thrown saying that the database was not found which left me confused. This makes me think the database name is different from the company name but I'm not sure how to get to the database name. 

    Anyone else use LookupCompanyIdentifier with this issue occurring?   

  • +1 in reply to Chris Krozel
    verified answer

    I wanted to mention that I did solve this issue after I found out that a CompanyIdentifier has a DatabaseName in it. I was not able to find the database name another way so not sure if there is an easier way.

    But if anyone else is having an issue with a slow connection to their database and you don't know the database name, my solution was to use the CompanyList call as explained above then output the database names to console. Once I figured out the database name I was able to use LookupCompanyIdentifier which decreased connection time significantly.