Using FQSaveToCache on large Invoices |
Author |
Message |
KofK |
|
Group | : Members |
Posts | : 43 |
Joined | : 2006-04-04 |
|
Profile |
|
Posted : 2007-05-03 03:20:44 |
I am trying to write an invoice that has a few hundred lines using FQSaveToCache.
The problem that I'm having is that as the invoice grows, each query takes longer and longer to execute even though FQSaveToCache = 1.
I tried to process the invoice in batches of a hundred but the problem still exists.
I thought that when using FQSaveToCache, QODBC doesnt query QuickBooks until FQSaveToCache = 0 so why does it make a difference as to how many lines there are?
I currently do not have the Optimizer on will it help to turn it on for INSERT statements?
(I am using QuickBooks Pro 2007 and QODBC 7.00.00.214) |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-05-03 10:58:56 |
This is not quite what we had in mind when using QODBC. Yes, the QODBC optimizer should be on, but it makes no difference when doing INSERTs. What you need to do is to first create the first line of the Invoice and then add each invoice line to the newly created invoice as shown using the Plan B technique in: Using ClassRefListID when inserting invoice lines |
|
|
|
KofK |
|
Group | : Members |
Posts | : 43 |
Joined | : 2006-04-04 |
|
Profile |
|
Posted : 2007-05-03 11:23:09 |
Here is what I tried.
I inserted the first record setting FQSaveToCache = 0, the next two hundred records I set FQSaveToCache = 1 and used the TxnID (SP_LASTINSERTID) of the first line. The problem still exists that as it loops through the 200 records it gets slower and slower. (after about 150 it takes almost 20 seconds to execute) |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-05-03 11:30:58 |
I believe you, I don't think I've every seen anyone that expected the Intuit qbXML SDK to write so many invoice lines, so the more lines the slower it becomes to add lines. Most likely the underlying SDK code by Intuit needs optimizing, not something we can do, sorry. |
|
|
|
KofK |
|
Group | : Members |
Posts | : 43 |
Joined | : 2006-04-04 |
|
Profile |
|
Posted : 2007-05-03 11:42:17 |
Thanks for the reply.
When I use FQSaveToCache = 1 does it query QuickBooks at all or is it stored until FQSaveToCache =0?
If it's stored why would it make a difference as to the number of invoice lines? |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2007-05-03 12:29:33 |
That's because everything is still processed apart for the actual commit operation. |
|
|
|