Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : ASP.NET Web Service - Slow INSERTS (SalesOrder)Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v8 Forum

 New Topic 
 
 Post Reply 
[1]  
 ASP.NET Web Service - Slow INSERTS (SalesOrder) 
 Author   Message 
  Redbox Digital 
  
 Group: Members 
 Posts: 4 
 Joined: 2008-05-08 
 Profile
 Posted : 2008-07-23 18:50:24
We have created an ASP.NET (framework 2.0) webservice that resides on our QuickBooks v8 Enterprise server. The web service allows us to create a new SalesOrder within our Quickbooks file. The application works, however on bigger orders (39 line items) it takes 30 minutes to get the whole SalesOrder in which will be impossible to work with when we get bigger and lots of orders.

We then have an ASP.NET application on another server that interacts with this web service.

I have gone through a number of forum posts and I have added the following without any improvements:
  • Keeping the connection open and shared across all SalesOrderLine INSERTS
  • Adding AspCompat="true" to the ASP.NET aspx page that calls the web service
  • [STAThreadAttribute] added to each web method in the Web Service
It currently takes between 15 and 30 seconds for each insert which soon adds up for bigger orders

Other information:

- Connection String in use: DSN=Quickbooks Data;OLE DB Services=-2;
- Optimizer: Turned off on the ODBC DSN
- Using DCOM server
- Quickbooks machine running Windows Server 2003

Please let me know what else we need to try to speed this thing up. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-07-23 21:08:13
Turn the optimizer back on!!! And then check your optimization settings to use the The start of every new connection (with "Load Updated Data" first) option and confirm that the Multi-Table Sync option has been disabled. If not, uncheck the Multi-Table Sync option as this is often defaulted on (checked) with QuickBooks Enterprise. And make sure you don't have "Optimize data after an Insert or Update" checked (like shown below). 

For large batches you can also try SP_BATCH, see: Are there any special stored procedures that can assist me in programming? 

 

  Top 
  Redbox Digital 
  
 Group: Members 
 Posts: 4 
 Joined: 2008-05-08 
 Profile
 Posted : 2008-08-01 00:15:33
Tom,

Thanks for the reply.

I have configured the ODBC setup with the optimizer settings as you provided.

When I try the application again with this turned on it hangs, and nothing gets logged in any of the logs to help me understand the problem.

I then tried clicking the "Load Updated Data" button so it could do a refresh of QB data to the opt file, however this gives me the following error:

            Load Updated Data did not complete (5)

And the QODBCLOG.txt shows the following:

2008-07-31 10:11:12 QODBC Ver:  8.00.00.242 *********************************************************************************************************************
IsAService: False
Error Code: 26
SQLOptimize_OpenOptimizeDBHandle prepare:
SELECT "type", "tbl_name" FROM "SQLite_MASTER"
file is encrypted or is not a database

Can you please shed any light on the above?

Thank you in advance for your assistance.

Kel. 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-08-01 07:57:11
The anonymous (or authenticated) web user IUSR_machinename, ASPNET user and INTERACTIVE must all have full rights to the optimizer folder. 

ASP.NET runs queries as multiple treads, and the QODBC optimizer is single user only. So you need to setup a different optimizer file for the ASP.NET application to use than the other disktop applications. To do this, set up a seperate System DSN (see: How do I create or configure a QODBC DSN? ) and specify a fixed location of the optimizer database folder for the ASP.NET application to use (like: C:\Program Files\QODBC Driver for QuickBooks) instead of the default %UserProfile% method. Finally the user or system account used (Anonymous web user IUSR_machinename, ASPNET user and INTERACTIVE) by the ASP.NET application must all have full rights to the optimizer folder.

You don't need to optimize all the QODBC tables if you're just using a handful of tables. Simply rebuild (sp_optimizefullsync) or update (sp_optimizeupdatesync) the tables you use from within your ASP.NET application using:

sp_optimizefullsync InvoiceLine

sp_optimizeupdatesync InvoiceLine

See: How do I setup the QODBC Optimizer? Where are the Optimizer options?  for more on how the optimize works.

 

  Top 
  Redbox Digital 
  
 Group: Members 
 Posts: 4 
 Joined: 2008-05-08 
 Profile
 Posted : 2008-08-02 02:05:36
We have already done the change of directory for the DSN and all these accounts have full control to the directory.

We still get the same error message when trying to manual update the data.

Anything else I can be checking for this to work? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-08-02 07:34:34
Try reseting your optimzer file, see: How do I switch OFF or RESET the QODBC optimizer?  

  Top 
  Redbox Digital 
  
 Group: Members 
 Posts: 4 
 Joined: 2008-05-08 
 Profile
 Posted : 2008-08-05 02:35:30
Thanks Tom.

I have successfully removed the OPT file from the optimizer directory. I can now load updated data without error.

We have now optimised Customer & SalesOrderLin.e We have changed our application to run sp_optimizeupdatesync SalesOrderLine AND sp_optimizeupdatesync Customer  when it begins to control what is optimised.

When ever we run the sp_optimizeupdatesync commands in our ASP.NET webservice it just hangs still. We get the following SDK messages:

20080804.122156    I    5600    RequestProcessor    ========= Started Connection =========
20080804.122156    I    5600    RequestProcessor    Request Processor, QBXMLRP2 v7.0
20080804.122156    I    5600    RequestProcessor    Connection opened by app named 'FLEXquarters QODBC'
20080804.122156    I    5600    CertVerifier    The Authenticode signature validated OK.
20080804.122159    I    5600    RequestProcessor    Opening the file in the Multi-User mode.
20080804.122205    I    4360    QBSDKProcessRequest    Application named 'FLEXquarters QODBC' starting requests (process 5600).
20080804.122205    I    4360    SpecVersion    Current version of qbXML in use: 7.0
20080804.122205    I    4360    QBSDKMsgSetHandler    QUERY: Host
20080804.122205    I    4360    QBSDKMsgSetHandler    Request 1 completed successfully.
20080804.122205    I    4360    QBSDKMsgSetHandler    QUERY: Company
20080804.122205    I    4360    QBSDKMsgSetHandler    Request 2 completed successfully.
20080804.122205    I    4360    QBSDKMsgSetHandler    QUERY: DataExtension Definition
20080804.122205    I    4360    QBSDKMsgSetHandler    Request 3 completed successfully.
20080804.122205    I    4360    MsgSetHandler    Finished.
20080804.122205    I    4360    QBSDKProcessRequest    Application named 'FLEXquarters QODBC' finishing requests (process 5600), ret = 0.

And we get the following Event Viewer entry multiple times:

The description for Event ID ( 4 ) in Source ( QuickBooks ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: QuickBooks, Returning NULL QBWinInstance Handle.

Have you come across this message before?
 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-08-05 07:42:21

The stored procedure:

sp_optimizeupdatesync SalesOrderLine

returns null (no rows), so that's most likely the problem. Once the tables have been optimized you don't need to run sp_optimizeupdatesync SalesOrderLine as this is done automatically by QODBC. If you need to rebuild a optimized table simply use the VERIFY tag like this:

SELECT "Name","LastName","FirstName","BillAddressAddr1",
"BillAddressAddr2","BillAddressCity",
"BillAddressState","BillAddressPostalcode"
from Customer VERIFY

 

  Top 
  Stephan 
  
 Group: Members 
 Posts: 3 
 Joined: 2008-09-05 
 Profile
 Posted : 2008-09-05 14:23:11

We are trying to set up and ASP.NET program that reads customer data from Quickbooks using QODBC.    The platform is WIndows Server 2003.  We have the Use DCOM servers checked and setup all the authorizations.  We are using ADODB, but on opening the connection it hangs and eventually gives a timeout error.  I have read through all I could find, but cannot get passed this problem.  Please help.

Thanks

Stephan

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-09-05 19:19:49
Well you can start off by ensuring qbcust.asp works as in: How can I see QuickBooks data in a Internet Explorer Browser using Windows XP? first. The second idea would be to start with a small QuickBooks table. Using one of QuickBooks Sample Company file is easiest way to do this. 

  Top 
  Stephan 
  
 Group: Members 
 Posts: 3 
 Joined: 2008-09-05 
 Profile
 Posted : 2008-09-08 15:42:48
We have already gone through that post and did all that.  There is one further development.  We installed Visual Web Developer on the server and in a debugging session we could actually get the data.  But as soon as we copy the program to c:\Inetpub\wwwroot\ it takes much longer and eventually gives the timeout.  Any further ideas? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-09-09 00:26:02
qbcust.asp should have given you an errror. What was it? 

  Top 
  Stephan 
  
 Group: Members 
 Posts: 3 
 Joined: 2008-09-05 
 Profile
 Posted : 2008-09-09 14:16:30

It simply gives a "HTTP Error 404 - File or directory not found. Internet Information Services (IIS)" I think it is because this is an .ASP file and not .ASPX.  We have two asp.net projects running on this server and they work fine.  I tried to put this file on .net platform 2.0 and also in 1.1, but both gave this error.


 

  Top 
  Juan Pineda 
  
 Group: Members 
 Posts: 5 
 Joined: 2008-09-10 
 Profile
 Posted : 2008-09-10 05:28:08
Hello,

we have tried to replace the webservice application for a console application on c#.

We have applied the [STAThread] attribute as per the post
http://www.qdeveloper.com.au/forum.php?homeinclude=topicdetails&forum_id=1&category_id=40&post_id=1809

We have also added the VERIFY parameter on our queries and also the FQSaveToCache in our inserts but none of them seem to be making any difference.

I'm posting our code here to see if anybody has had the same problem and can give us a hand

Many thanks

[STAThread]
        internal static string ExecuteNonQuery(string query, string table, DataConnection qbConnection)
        {
            log4net.Config.XmlConfigurator.Configure();

            ILog log = LogManager.GetLogger(typeof(DataAccess));

            if (log.IsDebugEnabled)
                log.Debug("Running query '" + query + "'");

            OdbcConnection connection = qbConnection.ActiveConnection;

            string returnId = null;
           
            try
            {
                OdbcCommand command = new OdbcCommand();
                command.CommandText = query;
                command.Connection = connection;
                command.CommandType = System.Data.CommandType.Text;

                command.ExecuteNonQuery();

                command.CommandText = "sp_lastinsertid " + table;

                OdbcDataReader reader = command.ExecuteReader();


                try
                {
                    if (reader.Read())
                    {
                        returnId = reader[0].ToString();
                    }
                }
                finally
                {
                    if (reader != null)
                    {
                        reader.Close();
                        reader.Dispose();
                        reader = null;
                    }


                }
            }
            catch (Exception ex)
            {
                log.Fatal(ex.Message + "(" + ex.Source + ")" );
                throw ex;
            }
            finally
            {
            }

            return returnId;


       }


 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to