Query fails momentarily for PO_HEADERS table
We have a custom program which gets executed before APXIIMPT.
The program gets the charge account for the invoices yet to be processed from the interface using the PO Number, PO Line Number and PO Shipment Number populated in the ITEM lines.
The query to get the above information from PO_HEADERS table throws an exception and fails sometimes, but may work with the same invoice without any change to the data.
What might be the reasons as to why a query to PO_HEADERS fail?