I apologize if the following is lengthy or incomprehensible. As you're well aware, when you get too close to a problem it becomes difficult to describe it clearly.
We have a small application that utilizes the SDK to pull data from a csv file produces by a web business and import it into Quickbooks. The application has been adapted to work through multiple versions of Quickbooks up from Enterprise 3 to Enterprise 5 without incident. The recent upgrade to Enterprise 6 has brought a bug with it however, and as near as I can tell, it is either in the SDK or in Quickbooks itself.
The nature of the problem is that Quickbooks experiences a fatal crash when the import sends a Message Request that includes InvoiceAddRequests. The crash is intermittent, apparently random, and most disturbingly seems to be linked to a particular company file. We have tried a great many things to narrow down the problem, including upgrading to the latest SDK, upgrading Quickbooks to the most recent patch (including the R5 patch just released), altering the code that sends the requests in many different ways, all to no avail.
Since it appears to only happen with one company file, we have performed multiple Verify and Rebuilds of the company file which never report any problems. I have even performed a Clean Up Company Data with all options checked, removing everything dated prior to 12/31/05 (obviously on a test copy of the company file). In addition, the SDK Test applications that are distributed with the SDK are able to successfully send the same requests that cause the crash through our application without fail.
In troubleshooting, it appears that specific rows of data were consistently causing the crash. As those "trouble" rows of data are removed from the file, continuing tests process data consistently past the removed rows (as would be expected) usually finding another "trouble" row to crash on.
The crashes are intermittent and random. Periodically, the program will run perfectly without a single error. Whenever an error occurs, however, it would occur on one of these discreet "trouble" rows. In analyzing these rows, I've been unable to determine any discernible pattern in the "trouble" rows compared to the rows that do not cause the crash.
In the QBWin.log file the error line that seems to be attached to the crash is: TransactionManager.cpp (2061) : MESSAGE: Mon Feb 27 11:26:01 LVL_FATAL_ERROR--Unexpected error condition 051012SLH in multi-user locking code acquiring the GlobalWriteLock.
The Report.xml file seems to confirm the TransactionManager.cpp problem:
- ProgrmmersFatalError C:\Program Files\Intuit\QuickBooks Enterprise Solutions
6.0\qbw32.exe- 0 2061 .\.\src\TransactionManager.cpp
Code snippet wherein the crash occurs.
Dim qbSess As QBSessionManager qbSess = New QBSessionManager Dim objInvoice As New InvoiceQB Dim msgSetRs As IMsgSetResponse
qbSess.OpenConnection("WOP", AppSettings("ApplicationName").ToString) qbSess.BeginSession("", ENOpenMode.omMultiUser)
Dim msgSetRq As IMsgSetRequest = qbSess.CreateMsgSetRequest("US", 5, 0) msgSetRq.Attributes.OnError = ENRqOnError.roeContinue
// Add invoice request to msgSetRs
msgSetRs = qbSess.DoRequests(msgSetRq)
KABOOM.