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 : QODBC and Windows ServiceSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 QODBC and Windows Service 
 Author   Message 
  William 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-04-19 
 Profile
 Posted : 2007-04-19 09:49:08

Hello all,

This forum has been invaluable in helping us get started using QODBC, and I would like to give a special thanks to Tom for all his hard work in answering our many questions :-)

I've read just about every posting in this forum on QODBC running under a Windows service, but I am still having a heck of a time getting the synchronization of data to work successfully, and on a timely basis.

This is going to be a long post, so you may want to get some Red Bull...

Summary of Project

We are responsible for synchronizing a SQL Server 2005 database with payment and customer information from QuickBooks, and synchronizing payment information entered by our users in the same SQL Server 2005 database, into QuickBooks.

We have written an .NET Web service that a Windows service may call to both send and retrieve the payment and customer information from and to the SQL Server 2005 instance.

We have written a Windows service that handles the communications with QuickBooks and the Web service.


Software Demographics for QODBC and QuickBooks

QuickBooks:  Premier 2007 with all the latest patches
QuickBooks Data File:  Located on a mapped network drive
Data File Size:  90 MB
QODBC: v 7.00.00.214 evaluation Server Edition
OS:  Windows XP Professional with all the latest service packs
DCOM:  DCOM has been enabled and I ran the DCOM configuration script from QODBC

QODBC Configuration

DCOM Configuration

Note... I'm just showing the launch and activation screen shot, but the access permissions and Configuration permissions are similar.  I used the DCOM configuration program supplied by QODBC to configure this.


Problem

The problem we are having, which seems to be typical of a lot of users is that synchronizing the data from QuickBooks using QODBC is extremely slow.

I have tried running the Optomizer with all the different settings, including turning it off, and it doesn't seem to make any difference what so ever on the speed of extracting data from Quick Books.  I have also followed the directions on resetting the Optomizer file, but to no avail.

When I say it takes a long time, I have yet to see it finish, and this is after 48 hours.  I usually get an error in the log file such as this:

2007-04-18 09:34:12 QODBC Ver:  7.00.00.214 *********************************************************************************************************************
IsAService: True
SQLOptimize_OpenOptimizeDBHandle prepare:
SELECT "type", "tbl_name" FROM "SQLite_MASTER"
file is encrypted or is not a database

From this error, I would assume that QODBC was either having trouble accessing the file, or the file was corrupt.  I'm running the service as myself for now, and I certainly have access to the local file.  As stated previously, I have followed the directions on resetting the Optimizer file, and re-generating it, so it shouldn't be corrupted.

We have made sure we are not using "SELECT * from tablename", and have used the JumpIn columns where we could. The following are the SQL statements we are using.  All of them take hours to complete, and we are talking about a few thousand records is all.


Get Customers

SELECT ListID, TimeCreated, TimeModified, EditSequence, Name, FullName,
AccountNumber, FirstName, LastName, BillAddressAddr1, BillAddressAddr2,
BillAddressAddr3, BillAddressAddr4, BillAddressCity, BillAddressState,
BillAddressPostalCode, BillAddressCountry, Email, Phone, AltPhone,
CustomerTypeRefFullName, CustomerTypeRefListID, isActive
FROM Customer NOSYNC
WHERE CustomerTypeRefFullName IN ('Van Pooler')


Get Payments for a particular TxnID (Two separate queries)

SELECT CustomerRefFullname, CustomerRefListID, EditSequence, Memo, PaymentMethodRefFullName,
PaymentMethodRefListID, RefNumber, TimeCreated, TimeModified, TotalAmount, TxnDate, TxnID, TxnNumber, UnusedCredits, UnusedPayment
FROM ReceivePayment NOSYNC
WHERE TxnID = '?'


SELECT AppliedToTxnPaymentAmount, AppliedToTxnBalanceRemaining, AppliedToTxnDiscountAmount,
AppliedToTxnTxnID, TxnID, RefNumber, TxnDate "
FROM ReceivePaymentLine NOSYNC
WHERE TxnID = '?'


Insert a payment (Dynamically built Values list)

INSERT INTO ReceivePayment (CustomerRefListID, ARAccountRefListID, RefNumber, PaymentMethodRefFullName, 
DepositToAccountRefListID, TotalAmount, IsAutoApply, TxnDate)
Values...


Get Invoices (two separate queries)


SELECT DISTINCT invoice.TxnID,invoice.TimeCreated,invoice.TimeModified, "
invoice.EditSequence, invoice.TxnNumber, invoice.CustomerRefListID CustomerListID,
invoice.CustomerRefFullName CustomerFullName, invoice.TxnDate, invoice.RefNumber,
invoice.IsPending, invoice.IsFinanceCharge, invoice.PONumber, invoice.DueDate, 
invoice.Subtotal, invoice.SalesTaxTotal, invoice.AppliedAmount, invoice.BalanceRemaining
FROM invoice NOSYNC
INNER JOIN customer NOSYNC ON (invoice.CustomerRefListID = customer.ListID)
WHERE customer.CustomerTypeRefFullName IN ('Van Pooler')
AND invoice.TimeModified > {ts 'yyyy-MM-dd HH:mm:ss.fff'}

SELECT txnID, InvoiceLineTxnLineID, InvoiceLineItemRefListID, InvoiceLineItemRefFullName,
InvoiceLineDesc, InvoiceLineQuantity, InvoiceLineRate, InvoiceLineRatePercent, InvoiceLineAmount
FROM invoiceLine NOSYNC
WHERE txnID = '?'

 


Note:  Everywhere you see the NOSYNC statement being used, we are calling the following Stored Procedures to make sure the data is optomized.  This is not done in a loop, but is done once per feature (Get Invoices, Get Customers, etc)

                // open a connection to the QB database
                conn = new System.Data.Odbc.OdbcConnection(QBAPISettings.Current.QbDatabaseConnection);
                conn.ConnectionTimeout = 300; // 5 minutes
                conn.Open();

                command = conn.CreateCommand();
                command.CommandTimeout = 10800; // 3 hours
                command.CommandType = CommandType.Text;


                // **************  OPTIMIZE tables ******************
                command.CommandText = "sp_optimizeupdatesync Customer";
                //execute the command
                command.ExecuteNonQuery();

Obviously, "Customer" is replaced for each table we need to update

We are also careful not to open and close a connection to QODBC in a loop.  The connection is opened and closed once per feature.

Here is an example of the complete code for getting all the customers (Note, this will take about 2 hours to run under .NET, but only a few mintues under the VB Demo program.  I'm thinking this may be the case because we are using DCOM in the .NET environment due to it running as a service:


        /// <summary>
        /// Gets a list of customers modified since lastSyncDateTime.
        /// </summary>
        /// <param name="lastSyncDateTime">Last time a syncronization occured.</param>
        /// <returns>ArrayList that contains a collection of QBCustomers.</returns>
        private ArrayList GetCustomers(DateTime lastSyncDateTime)
        {
            ArrayList customerList = new ArrayList();
            OdbcConnection conn = null;
            OdbcCommand command = null;
            OdbcDataReader dr = null;
            string sql = "SELECT ListID, TimeCreated, TimeModified, EditSequence, Name, FullName," +
                            "AccountNumber, FirstName, LastName, BillAddressAddr1, BillAddressAddr2, " +
                            "BillAddressAddr3, BillAddressAddr4, BillAddressCity, BillAddressState, " +
                            "BillAddressPostalCode, BillAddressCountry, Email, Phone, AltPhone, " +
                            "CustomerTypeRefFullName, CustomerTypeRefListID, isActive " +
                            "FROM Customer NOSYNC " +
                            "WHERE CustomerTypeRefFullName IN (" + QBAPISettings.Current.QbCustomerTypes + ")";

            try
            {

                //// filter the list of customer records by the last sync date
                if (lastSyncDateTime != DateTime.MinValue)
                {
                    // add the time modified filter using UTC time
                    sql += " AND TimeModified > {ts '" + lastSyncDateTime.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'}";
                }

                // open a connection to the QB database
                conn = new System.Data.Odbc.OdbcConnection(QBAPISettings.Current.QbDatabaseConnection);
                conn.ConnectionTimeout = 300; // 5 minutes
                conn.Open();

                command = conn.CreateCommand();
                command.CommandType = CommandType.Text;
                command.CommandTimeout = 10800; // 3 hours


                //// **************  OPTIMIZE tables ******************
                command.CommandText = "sp_optimizeupdatesync Customer";
                // execute the command
                command.ExecuteNonQuery();


                // Create a command to get the customers
                command.CommandText = sql;
                // exectute the command
                dr = command.ExecuteReader(CommandBehavior.Default);

                // process the results
                while (dr.Read())
                {
                    QBCustomer cust = new QBCustomer();

                    cust.AccountNumber = (dr.IsDBNull(dr.GetOrdinal("AccountNumber")) ? "" : dr.GetString(dr.GetOrdinal("AccountNumber")));
                    cust.BillAddr1 = (dr.IsDBNull(dr.GetOrdinal("BillAddressAddr1")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressAddr1")));
                    cust.BillAddr2 = (dr.IsDBNull(dr.GetOrdinal("BillAddressAddr2")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressAddr2")));
                    cust.BillAddr3 = (dr.IsDBNull(dr.GetOrdinal("BillAddressAddr3")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressAddr3")));
                    cust.BillAddr4 = (dr.IsDBNull(dr.GetOrdinal("BillAddressAddr4")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressAddr4")));
                    cust.BillCity = (dr.IsDBNull(dr.GetOrdinal("BillAddressCity")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressCity")));
                    cust.BillCountry = (dr.IsDBNull(dr.GetOrdinal("BillAddressCountry")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressCountry")));
                    cust.BillPostalCode = (dr.IsDBNull(dr.GetOrdinal("BillAddressPostalCode")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressPostalCode")));
                    cust.BillState = (dr.IsDBNull(dr.GetOrdinal("BillAddressState")) ? "" : dr.GetString(dr.GetOrdinal("BillAddressState")));
                    cust.CustomerTypeFullName = (dr.IsDBNull(dr.GetOrdinal("CustomerTypeRefFullName")) ? "" : dr.GetString(dr.GetOrdinal("CustomerTypeRefFullName")));
                    cust.CustomerTypeListID = (dr.IsDBNull(dr.GetOrdinal("CustomerTypeRefListID")) ? "" : dr.GetString(dr.GetOrdinal("CustomerTypeRefListID")));
                    cust.EditSequence = (dr.IsDBNull(dr.GetOrdinal("EditSequence")) ? "" : dr.GetString(dr.GetOrdinal("EditSequence")));
                    cust.Email = (dr.IsDBNull(dr.GetOrdinal("Email")) ? "" : dr.GetString(dr.GetOrdinal("Email")));
                    cust.FirstName = (dr.IsDBNull(dr.GetOrdinal("FirstName")) ? "" : dr.GetString(dr.GetOrdinal("FirstName")));
                    cust.FullName = (dr.IsDBNull(dr.GetOrdinal("FullName")) ? "" : dr.GetString(dr.GetOrdinal("FullName")));
                    cust.IsActive = (dr.IsDBNull(dr.GetOrdinal("isActive")) ? false : dr.GetBoolean(dr.GetOrdinal("isActive")));
                    cust.LastName = (dr.IsDBNull(dr.GetOrdinal("LastName")) ? "" : dr.GetString(dr.GetOrdinal("LastName")));
                    cust.ListID = (dr.IsDBNull(dr.GetOrdinal("ListID")) ? "" : dr.GetString(dr.GetOrdinal("ListID")));
                    cust.Name = (dr.IsDBNull(dr.GetOrdinal("Name")) ? "" : dr.GetString(dr.GetOrdinal("Name")));
                    cust.Phone = (dr.IsDBNull(dr.GetOrdinal("Phone")) ? "" : dr.GetString(dr.GetOrdinal("Phone")));
                    cust.SecondPhone = (dr.IsDBNull(dr.GetOrdinal("AltPhone")) ? "" : dr.GetString(dr.GetOrdinal("AltPhone")));
                    cust.TimeCreated = (dr.IsDBNull(dr.GetOrdinal("TimeCreated")) ? DateTime.MinValue : dr.GetDateTime(dr.GetOrdinal("TimeCreated")));
                    cust.TimeModified = (dr.IsDBNull(dr.GetOrdinal("TimeModified")) ? DateTime.MinValue : dr.GetDateTime(dr.GetOrdinal("TimeModified")));

                    customerList.Add(cust);
                }
            }
            catch (Exception ex)
            {
                QBSyncLogger.Write(m_QBSyncStatus.SyncObject, "Error", ex.ToString());
            }
            finally
            {
                if (dr != null) dr.Close();
                if (conn != null) conn.Close();
            }

            return customerList;
        }

 

I have monitored the service in Windows Task Manager, and have seen the following:

When the application first starts, I see that QuickBooks is loaded, as well as the DCOM wrapper.  QuickBooks starts using up to 20% CPU for the first few minutes, then my application goes to 100% CPU usage for the next two hours.  If I monitor this with FileMon.exe, I can see that the msxml4.dll is being accessed over and over again with about 10ms between access usage.  I'm assuming that this is QODBC cycling through the XML file that QuickBooks produced.

Can anyone see where I might have a configuration wrong, or maybe doing something incorrectly in the code?

Any help on this would be greatly appreciated.

Regards (or should I say G'day Mate)

 

 

 

 

 

 

 

 

 

 

 
William G. Oliver
Director of Engineering
Pacific Intermedia, Inc.
Portland, Oregon USA 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-04-19 11:43:55

First I need to say that using a WHERE statement like: WHERE customer.CustomerTypeRefFullName IN ('Van Pooler') has to be evaluated during execution by QODBC and no jump-in can be used. But that's not the problem here.

Have you looked at what Andrew Rachmiel, at BrightStar Partners, Inc did in: Using DTS to Load QuickBooks Data into Microsoft SQL Server ?

The problem here isn't the DCOMs or Windows Service but QODBC really needs a STA (single-threaded-apartment) threading model, which the COM components rely upon when returning calls. Everytime a tread ID changes we have to setup another QuickBooks connection which takes a lot of time.

See also: ASP.NET vs Classic ASP 

 

  Top 
  William 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-04-19 
 Profile
 Posted : 2007-04-20 04:31:37

Thanks for the reply, Tom.

We will probably change the "in ('Van Pooler') to "=", since we only have one type we are looking for, and I don't think this will change in the near future.

Now, just to clarify, we are not going through ASP.NET.  This is a stand-alone C# console application that gets called from a Windows Service Scheduler which is also written in C#.  I understand about the STA, and maybe the .NET Framework 2.0 is doing something behind the scenes that I am not aware of.

We did attempt to use DTS to access the data, but since we are doing a little more with the data than just transfering it, it was decided to just use a stand-alone console application instead.  We could still use DTS, but then we would have to call out to some .NET assemblies to perform the additional work, or change our model to load the data into SQL Server, and then have another application work on that imported data.  Since we are already behind on the schedule, I would like to use this as a last resort.

Do you know of a way to see if QODBC is opening and closing connections multiple times?  I've turned on tracing, and didn't notice anything out of the ordinary.

Also, did you see the error message I am getting?

IsAService: True
SQLOptimize_OpenOptimizeDBHandle prepare:
SELECT "type", "tbl_name" FROM "SQLite_MASTER"
file is encrypted or is not a database

I've searched for this error, and haven't seen anything in the forums about it.  Can you tell me what this means?

Some other background info:

I had installed the QuickBooks SDK on my test computer prior to installing QODBC.  Should I remove this?

 

Thanks again,

 

 

 

 
William G. Oliver
Director of Engineering
Pacific Intermedia, Inc.
Portland, Oregon USA 
 
  Top 
  William 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-04-19 
 Profile
 Posted : 2007-04-20 08:07:42

Here is some additional information:

An excerpt from the QODBC Trace file  (I only turned it on for one run to see what was happening)

ISAMOpen
    Database: X:\qb\North Front Range MPO.QBW
    DSN: QB Van Pool Data Exchange
    UserName:
    Password:
    DeveloperCode:
    ApplicationCode:
    OpenMode: F
    UseDCOM: Y
    IBizRemoteConnection: N
    IBizRemoteURL: http://localhost:2080
    IBizRemoteUserName: admin
    IBizRemotePassword:
    IBizRemoteAskPassword: Y
    IBizRemoteSSLAcceptServerCert:
    IBizRemoteConnectionTimeOut: 120
    IBizRemoteForce2002_2003: N
    IBizOEConnection: N
    IBizOETicketGUID:
    IBizOELoginGUID:
    IBizOELoginAsk: Y
    IBizReconnectionDelay: 0
    ColumnNameLen: 50
    UseCaseSensitiveRefNumber: N
    OptimizerOn: Y
    OptimizerDBFolder: C:\
    OptimizerCurrency: O
    OptimizerDirtyReads: R
    OptimizerUpdateSync: Y
    OptimizerEncrytionOn: Y
    UseIterators: Y
    IteratorChunkSize:  20000
    IAppLaunchQBUI: N
    IAppAutomaticLogin: Y
    IAppReadOnly: N
    IAppAllowPersonalData: Y
    ConvertToLongVARCHAR: FALSE
    MaxLONGVARCHAR:  4096
    Convert To LONGVARCHAR: N
    Max LONGVARCHAR:   4096
    OleInitialize - Returned OK
    Logged In User:    WOliver
    Is a Service:      Yes
    Registration Name:
    RegSerial:        
    QODBC Version:     7.00.00.214
    DLL:               C:\WINDOWS\system32\fqqb32.dll
    Driver Name:       FQQB32.DLL
    Process Count:     1
    Thread Count:      5
    OpenMode:          Follow Company
    Include Raw:       No
    Version Type:      Evaluation QODBC Server Edition 2008
    Access Method:     QBXMLRP2EQODBCInteractive.exe
    Thread ID:         4940
    SDK Module:        QBXMLRP2EQODBCInteractive.exe
    QB Company Name:   X:\qb\North Front Range MPO.QBW
    QB Product Name:   QuickBooks: Premier Accountant Edition 2007 Trial Version
    QB Major Version:  17
    QB Minor Version:  0
    QB File Mode:      MultiUser
    QB Automatic Login:Yes
    QB Country:        US
    QB Supported Ver:  1.0
    QB Supported Ver:  1.1
    QB Supported Ver:  2.0
    QB Supported Ver:  2.1
    QB Supported Ver:  3.0
    QB Supported Ver:  4.0
    QB Supported Ver:  4.1
    QB Supported Ver:  5.0
    QB Supported Ver:  6.0
    Optimize SQLITE3 Library Version: 3003007
    Optimize File Contents: C:\North Front Range MPO.OPT
        type                      name                      tbl_name                  rootpage                  sql                                                                                                 
        ========================= ========================= ========================= ========================= ====================================================================================================
        table                     FQOptimizeList            FQOptimizeList            2                         CREATE TABLE "FQOptimizeList"("FQOptimizeList_OptimizeName" VARCHAR(50) NOT NULL UNIQUE COLLATE NOCA
        index                     sqlite_autoindex_FQOptimi FQOptimizeList            3                                                                                                                             
        table                     FQOptimizeVersion         FQOptimizeVersion         4                         CREATE TABLE "FQOptimizeVersion" ("FQOptimizeVersion_CompanyName" VARCHAR(1000), "FQOptimizeVersion_
    FQOptimizeList Contents
        OptimizeName              TableList                 SQL                       LastTimeModified          LastTimeDeleted           LastTransactionTimeModifi LastTransactionTimeModifi LastTransactionTimeModifi LastTransactionTimeModifi TimeOfSecu
        ========================= ========================= ========================= ========================= ========================= ========================= ========================= ========================= ========================= ==========
    FQOptimizeVersion Contents
        CompanyName               Version                  
        ========================= =========================
        North Front Range MPO     3                        
    Optimize File: C:\North Front Range MPO.OPT
    0x001A6F78 [ISAM]
    NO_ISAM_ERR 00000 00000
ISAMPrepare
    0x001A6F78 [ISAM]
    SELECT ListID, TimeCreated, TimeModified, EditSequence, Name, FullName,AccountNumber, FirstName, LastName, BillAddressAddr1, BillAddressAddr2, BillAddressAddr3, BillAddressAddr4, BillAddressCity, BillAddressState, BillAddressPostalCode, BillAddress
    Country, Email, Phone, AltPhone, CustomerTypeRefFullName, CustomerTypeRefListID, isActive FROM Customer NOSYNC WHERE CustomerTypeRefFullName IN ('VanPooler')
    405
    0x00000000 [ISAMStatement]
   
    0
    10003
ISAMCaseSensitive
    0x001A6F78 [ISAM]
    FALSE
ISAMMaxTableNameLength
    0x001A6F78 [ISAM]
    63
ISAMOpenTable
    0x001A6F78 [ISAM]
    Table Name: Customer
    Table Alias:
    Read Only: TRUE
    Query Index: 1
    Unoptimized: FALSE
    NoSync: TRUE
    DoSync: FALSE
    DoFullSync: FALSE
    DoChunking: FALSE
    Elapsed Time: 00:00:00 Time Difference: 00:00:00.000 Open Table
    0x001F52C0 [Customer]
        Table Name:Customer
        Column Count: 86
            Column Name: ListID
                SQL Type: SQL_VARCHAR
                Precision: 36
                Scale: 0
                Nullable: 0
                Selectivity: 1
                Key Component: 1
<snip>

Nothing in the QODBC Messages file

SDK Messages:


20070419.144502 I 5768 RequestProcessor ========= Started Connection =========
20070419.144502 I 5768 RequestProcessor Request Processor, QBXMLRP2 v6.0
20070419.144502 I 5768 RequestProcessor Connection opened by app named 'FLEXquarters QODBC'
20070419.144502 D 5768 CRLInstaller CRL path is: D:\Program Files\Intuit\QuickBooks 2007\Components\Services\
20070419.144502 D 5768 CRLInstaller No new CRL files found.
20070419.144502 I 5768 CertVerifier The Authenticode signature validated OK.
20070419.144502 D 5768 CertVerifier Success with ImageEnumerateCertificates.  Cert count is 1
20070419.144502 D 5768 CertVerifier Got 5640 bytes of cert data.
20070419.144502 D 5768 CertVerifier Got the signer info.
20070419.144502 D 5768 CertVerifier Cert count in crypt message is 4.
20070419.144502 D 5768 CertVerifier Found signature certificate.
20070419.144502 D 5768 CertVerifier   simple issuer: VeriSign Class 3 Code Signing 2004 CA
20070419.144502 D 5768 CertVerifier   simple subject: FLEXquarters.com LLC
20070419.144502 D 5768 CertVerifier   version: 2
20070419.144502 D 5768 CertVerifier   issuer: C=US, O="VeriSign, Inc.", OU=VeriSign Trust Network, OU=Terms of use at https://www.verisign.com/rpa (c)04, CN=VeriSign Class 3 Code Signing 2004 CA
20070419.144502 D 5768 CertVerifier   subject: C=US, S=Nevada, L=Las Vegas, O=FLEXquarters.com LLC, OU=Digital ID Class 3 - Microsoft Software Validation v2, CN=FLEXquarters.com LLC
20070419.144502 D 5768 CertVerifier   serial number: 74CCED6091E0E297F104303A20C3B1F7
20070419.144502 D 5768 CertVerifier   issueDate: 2006-10-05
20070419.144502 D 5768 CertVerifier   expirationDate: 2007-09-27T23:59:59+00:00
20070419.144502 D 5768 CertVerifier Got the Opus Info.
20070419.144502 D 5768 CertVerifier   no description found.
20070419.144502 D 5768 CertVerifier   no description URL found.
20070419.144502 D 5768 RequestProcessor Begin Session started...
20070419.144503 D 5768 RequestProcessor File info: "X:\qb\North Front Range MPO.QBW", v17.0R3 (564), accountant
20070419.144503 D 5768 RequestProcessor QuickBooks is not running.
20070419.144503 D 5768 RequestProcessor Starting QuickBooks (launch): Install info: v17.0R3 (564), accountant
20070419.144515 D 5768 RequestProcessor QuickBooks launch succeeded.
20070419.144515 I 5768 RequestProcessor Opening the file in the DoNotCare mode.
20070419.144531 D 5116 EventSub:Load No subscriptions found in data file.
20070419.144531 D 5116 EventSub:Synch No sub config file. Removing 0 event subscriptions.
20070419.144531 D 5116 COMEventHandler Create IQBEventCallback
20070419.144531 D 5116 COMEventHandler Error creating callback for ProSeries
20070419.144531 D 5116 COMEventHandler    Error Message: class not registered
20070419.144531 D 5768 RequestProcessor Successfully opened the data file: X:\qb\North Front Range MPO.QBW
20070419.144531 D 5768 RequestProcessor COM access to QuickBooks starting ...
20070419.144531 I 5116 QBSDKProcessRequest Application named 'FLEXquarters QODBC' starting requests (process 5768).
20070419.144531 D 5116 MacroManager::DumpMacroMap Map contains no entries
20070419.144531 D 5116 QBXMLMsgs HostQueryRq
20070419.144531 D 5116 QBXMLMsgs CompanyQueryRq
20070419.144531 D 5116 QBXMLMsgs DataExtDefQueryRq
20070419.144531 I 5116 SpecVersion Current version of qbXML in use: 6.0
20070419.144531 D 5116 MsgSetHandler Parsing took 0.1710 seconds
20070419.144531 I 5116 QBSDKMsgSetHandler QUERY: Host
20070419.144531 I 5116 QBSDKMsgSetHandler Request 1 completed successfully.
20070419.144531 I 5116 QBSDKMsgSetHandler QUERY: Company
20070419.144531 D 5116 CompanyStorage::BuildTheRetObject Company
20070419.144531 I 5116 QBSDKMsgSetHandler Request 2 completed successfully.
20070419.144531 I 5116 QBSDKMsgSetHandler QUERY: DataExtension Definition
20070419.144531 I 5116 QBSDKMsgSetHandler Request 3 completed successfully.
20070419.144531 D 5116 QBSDKMsgSetHandler There were total of 3 requests processed
20070419.144531 D 5116 MsgSetHandler Executing Requests took 0.016 seconds
20070419.144531 D 5116 MsgSetHandler Creating Response took 0.000 seconds
20070419.144531 D 5116 MsgSetHandler Response is 1505 characters long
20070419.144531 D 5116 MsgSetHandler Writing Response took 0.000 seconds
20070419.144531 D 5116 MacroManager::DumpMacroMap Map contains no entries
20070419.144531 I 5116 MsgSetHandler Finished.
20070419.144531 I 5116 QBSDKProcessRequest Application named 'FLEXquarters QODBC' finishing requests (process 5768), ret = 0.
20070419.144531 D 5768 RequestProcessor Finished processing requests, no errors.
20070419.144531 D 5768 RequestProcessor Processing requests took 0.219 seconds.

20070419.144803 I 3456 RequestProcessor ========= Started Connection =========
20070419.144803 I 3456 RequestProcessor Request Processor, QBXMLRP2 v6.0
20070419.144803 I 3456 RequestProcessor Connection opened by app named 'FLEXquarters QODBC'
20070419.144803 D 3456 CRLInstaller CRL path is: D:\Program Files\Intuit\QuickBooks 2007\Components\Services\
20070419.144803 D 3456 CRLInstaller No new CRL files found.
20070419.144803 I 3456 CertVerifier The Authenticode signature validated OK.
20070419.144803 D 3456 CertVerifier Success with ImageEnumerateCertificates.  Cert count is 1
20070419.144803 D 3456 CertVerifier Got 5640 bytes of cert data.
20070419.144803 D 3456 CertVerifier Got the signer info.
20070419.144803 D 3456 CertVerifier Cert count in crypt message is 4.
20070419.144803 D 3456 CertVerifier Found signature certificate.
20070419.144803 D 3456 CertVerifier   simple issuer: VeriSign Class 3 Code Signing 2004 CA
20070419.144803 D 3456 CertVerifier   simple subject: FLEXquarters.com LLC
20070419.144803 D 3456 CertVerifier   version: 2
20070419.144803 D 3456 CertVerifier   issuer: C=US, O="VeriSign, Inc.", OU=VeriSign Trust Network, OU=Terms of use at https://www.verisign.com/rpa (c)04, CN=VeriSign Class 3 Code Signing 2004 CA
20070419.144803 D 3456 CertVerifier   subject: C=US, S=Nevada, L=Las Vegas, O=FLEXquarters.com LLC, OU=Digital ID Class 3 - Microsoft Software Validation v2, CN=FLEXquarters.com LLC
20070419.144803 D 3456 CertVerifier   serial number: 74CCED6091E0E297F104303A20C3B1F7
20070419.144803 D 3456 CertVerifier   issueDate: 2006-10-05
20070419.144803 D 3456 CertVerifier   expirationDate: 2007-09-27T23:59:59+00:00
20070419.144803 D 3456 CertVerifier Got the Opus Info.
20070419.144803 D 3456 CertVerifier   no description found.
20070419.144803 D 3456 CertVerifier   no description URL found.
20070419.144803 D 3456 RequestProcessor Begin Session started...
20070419.144805 D 3456 RequestProcessor File info: "X:\qb\North Front Range MPO.QBW", v17.0R3 (564), accountant
20070419.144805 D 3456 RequestProcessor QuickBooks is not running.
20070419.144805 D 3456 RequestProcessor Starting QuickBooks (launch): Install info: v17.0R3 (564), accountant
20070419.144816 D 3456 RequestProcessor QuickBooks launch succeeded.
20070419.144816 I 3456 RequestProcessor Opening the file in the DoNotCare mode.
20070419.144831 D 2980 EventSub:Load No subscriptions found in data file.
20070419.144831 D 2980 EventSub:Synch No sub config file. Removing 0 event subscriptions.
20070419.144831 D 2980 COMEventHandler Create IQBEventCallback
20070419.144831 D 2980 COMEventHandler Error creating callback for ProSeries
20070419.144831 D 2980 COMEventHandler    Error Message: class not registered
20070419.144831 D 3456 RequestProcessor Successfully opened the data file: X:\qb\North Front Range MPO.QBW
20070419.144831 D 3456 RequestProcessor COM access to QuickBooks starting ...
20070419.144831 I 2980 QBSDKProcessRequest Application named 'FLEXquarters QODBC' starting requests (process 3456).
20070419.144831 D 2980 MacroManager::DumpMacroMap Map contains no entries
20070419.144832 D 2980 QBXMLMsgs HostQueryRq
20070419.144832 D 2980 QBXMLMsgs CompanyQueryRq
20070419.144832 D 2980 QBXMLMsgs DataExtDefQueryRq
20070419.144832 I 2980 SpecVersion Current version of qbXML in use: 6.0
20070419.144832 D 2980 MsgSetHandler Parsing took 0.1560 seconds
20070419.144832 I 2980 QBSDKMsgSetHandler QUERY: Host
20070419.144832 I 2980 QBSDKMsgSetHandler Request 1 completed successfully.
20070419.144832 I 2980 QBSDKMsgSetHandler QUERY: Company
20070419.144832 D 2980 CompanyStorage::BuildTheRetObject Company
20070419.144832 I 2980 QBSDKMsgSetHandler Request 2 completed successfully.
20070419.144832 I 2980 QBSDKMsgSetHandler QUERY: DataExtension Definition
20070419.144832 I 2980 QBSDKMsgSetHandler Request 3 completed successfully.
20070419.144832 D 2980 QBSDKMsgSetHandler There were total of 3 requests processed
20070419.144832 D 2980 MsgSetHandler Executing Requests took 0.016 seconds
20070419.144832 D 2980 MsgSetHandler Creating Response took 0.000 seconds
20070419.144832 D 2980 MsgSetHandler Response is 1505 characters long
20070419.144832 D 2980 MsgSetHandler Writing Response took 0.000 seconds
20070419.144832 D 2980 MacroManager::DumpMacroMap Map contains no entries
20070419.144832 I 2980 MsgSetHandler Finished.
20070419.144832 I 2980 QBSDKProcessRequest Application named 'FLEXquarters QODBC' finishing requests (process 3456), ret = 0.
20070419.144832 D 3456 RequestProcessor Finished processing requests, no errors.
20070419.144832 D 3456 RequestProcessor Processing requests took 0.204 seconds.
20070419.144834 D 3456 RequestProcessor COM access to QuickBooks starting ...
20070419.144834 I 2980 QBSDKProcessRequest Application named 'FLEXquarters QODBC' starting requests (process 3456).
20070419.144834 D 2980 MacroManager::DumpMacroMap Map contains no entries
20070419.144834 D 2980 QBXMLMsgs CustomerQueryRq
20070419.144834 I 2980 SpecVersion Current version of qbXML in use: 6.0
20070419.144834 D 2980 MsgSetHandler Parsing took 0.1870 seconds
20070419.144834 I 2980 QBSDKMsgSetHandler QUERY: Customer Job
20070419.144834 I 2980 CustomerStorage::DoQuery Setting iterator chunk size to 00000500
20070419.144858 D 2980 CustomerStorage::DoQuery Total number of customers: 500
20070419.144858 I 2980 QBSDKMsgSetHandler Request 1 completed successfully.
20070419.144858 D 2980 QBSDKMsgSetHandler There was 1 request processed.
20070419.144858 D 2980 MsgSetHandler Executing Requests took 24.562 seconds
20070419.144858 D 2980 MsgSetHandler Creating Response took 0.047 seconds
20070419.144858 D 2980 MsgSetHandler Response is 508545 characters long
20070419.144858 D 2980 MsgSetHandler Writing Response took 0.016 seconds
20070419.144858 D 2980 MacroManager::DumpMacroMap Map contains no entries
20070419.144858 I 2980 MsgSetHandler Finished.
20070419.144859 I 2980 QBSDKProcessRequest Application named 'FLEXquarters QODBC' finishing requests (process 3456), ret = 0.
20070419.144859 D 3456 RequestProcessor Finished processing requests, no errors.
20070419.144859 D 3456 RequestProcessor Processing requests took 24.875 seconds.

Note:  It says that QuickBooks is done with the query, but msxml4.dll continues to be accessed thousands of times in a few seconds as seen by this partial file dump from FileMon.exe: (Note:  SmartTrips is the name of our .NET console application which is started by a Windows service.

 

3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 576 Length: 40 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074176 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074176 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074192 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074192 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074408 Length: 2 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074408 Length: 2 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074410 Length: 14 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074410 Length: 14 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074200 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074200 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074424 Length: 2 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074424 Length: 2 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074426 Length: 14 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074426 Length: 14 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074240 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074240 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074256 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074256 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074312 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074312 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074328 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074328 Length: 8 
3:03:25 PM SmartTripsQuick:4012 FASTIO_CHECK_IF_POSSIBLE C:\WINDOWS\system32\msxml4.dll SUCCESS Read: Offset: 1074376 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_READ C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 1074376 Length: 16 
3:03:25 PM SmartTripsQuick:4012 FASTIO_QUERY_STANDARD_INFO C:\WINDOWS\system32\msxml4.dll SUCCESS Length: 1245696 
3:03:25 PM SmartTripsQuick:4012 FASTIO_QUERY_STANDARD_INFO C:\WINDOWS\system32\msxml4.dll SUCCESS Length: 1245696 
3:03:25 PM SmartTripsQuick:4012 IRP_MJ_CLEANUP C:\WINDOWS\system32\msxml4.dll SUCCESS  
3:03:25 PM SmartTripsQuick:4012 IRP_MJ_CLOSE  C:\WINDOWS\system32\msxml4.dll SUCCESS  
3:03:25 PM SmartTripsQuick:4012 IRP_MJ_CREATE  C:\WINDOWS\system32\msxml4.dll SUCCESS Options: Open  Access: Read 
3:03:25 PM SmartTripsQuick:4012 IRP_MJ_CREATE  C:\WINDOWS\system32\ SUCCESS Options: Open Directory  Access: 00100000 
3:03:25 PM SmartTripsQuick:4012 IRP_MJ_READ  C:\WINDOWS\system32\msxml4.dll SUCCESS Offset: 0 Length: 64 

 

Another interesting note is if I put the Optimizer file on the same network share as the company file, QODBC will connect with Quickbooks, but my application will die, and I don't see any error messages in any of the log files.

 

 
William G. Oliver
Director of Engineering
Pacific Intermedia, Inc.
Portland, Oregon USA 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-04-20 11:15:13
What is the speed like if you run your C# application stand alone (without being called by the Windows Service Scheduler)? 

  Top 
  William 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-04-19 
 Profile
 Posted : 2007-04-20 13:51:06

Good question.

I hadn't run it manually in quite awhile, so I did as you suggested, and the results are about the same so far.  My application just sits and spins at 99% CPU time, and it's using the MSXML4.dll over and over again.  This is with DCOM turned on.

If I turn DCOM off, and run the application manually, I see that the qbXMLRP2eQODBCInteractive.exe COM wrapper doesn't run, but it doesn't seem to make any difference on the speed of the app.

The Optimizer file also doesn't seem to be growing when it is in this loop.  It is currently at 404KB, but when I manually run the Optimzer through the QODBC Driver interface, it grows to about 92MB.  The manual Optimizer takes about 1.5 hours to run.  But, even if I manually run it, it doesn't seem to make a difference.

Prior to using QODBC, I could use the QBSDK, and run the application manually (as long as the company file was located on a local drive), and the application would take about 30 minutes to run.  I have tried putting the company file locally and running it as a service, but this made no difference.

I just tried using the local copy of the company file, and manually ran the application using QODBC and it didn't seem to make any difference.

One other bit of information I have seen.  the lsass.exe service (Windows local security and login policies service) seems to spike at 99% cpu when using QODBC.  Maybe it is trying to constantly authenticate me on our domain Active Directory?  I do have the service running as myself which is not a local account, but a domain account with admin permission on my workstation. lsass.exe will eventually drop down to 0% cpu when my application goes to 99% cpu.

 

 

 

 
William G. Oliver
Director of Engineering
Pacific Intermedia, Inc.
Portland, Oregon USA 
 
  Top 
  William 
  
 Group: Members 
 Posts: 5 
 Joined: 2007-04-19 
 Profile
 Posted : 2007-04-21 03:55:48

Just a little bit more information, because I figured my posts weren't taking up enough drive space :-)

I ran the TestDCOM.asp page supplied by QODBC, and got the following results:

QODBC ASP DCOM Access Test Page
QB2002QB2003QB2004DCOMCOMObject NameStatus
    QBXMLRPEQODBCInteractive.exe Success
    QBXMLRP.dll Success
      QBXMLRP2EQODBCInteractive.exe Success
      QBXMLRP2.dll Success
  XERCES-COM.dll Error: ActiveX component can't create object
Current Logged on User is:
Authenticated user is:

The Xerces-COM.dll failed because the asp page is looking for: Set oXERCES = CreateObject("Xerces.DOMDocument.2.4.0").  If I change it to Set oXERCES = CreateObject("Xerces.DOMDocument.2.5.0"), which is the version I have on my box, it can create the Xerces object.  I'm assuming 2.5 is backwards compatible with 2.4, being a COM object, but just though I would throw this out there.

 

 
William G. Oliver
Director of Engineering
Pacific Intermedia, Inc.
Portland, Oregon USA 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-05-01 11:29:54

At first guess it seems that Intuit has switched to MSXML4.DLL in QB2007 (its not us). They use DOM for building the XML they send to QODBC and the SAX parser when reading input from QODBC.

As far as your scheduled application is concerned, the QODBC optimizer is single user only, which means if a foreground and background application run at the same time, the .opt file can be currupted.

In your application you need to setup a connection string to use a unique instance of the optimizer only for your application like this:

DSN=QuickBooks Data;DFQ= ;SERVER=QODBC;UseDCOM=Y; OptimizerDBFolder=C:\scheduler; OptimizerAllowDirtyReads=N'

or can setup another completely different system DSN.

To optimize a table fully, run:

sp_optimizefullsync Customer

within your scheduled application and then check that the .opt file in C:\scheduler has increased in size.

I would do a

SELECT ListID FROM Customer CALLDIRECT WHERE CustomerTypeRefFullName = 'Van Pooler'

then do your long list of fields with another select using the list IDs from the first query. That way you are only getting a subset all the fields for the records you want, not all records.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to