Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BLOB leak with Ado & Recordset & AddNew & UpdateBatch

452362Sep 6 2005
I am using Oracle 10g Release 1, and I am experiencing a leak assoicated with BLOB fields with every Ado Recordset AddNew with UpdateBatch.
I am using Ado 2.81 with C++ on Windows XP, ADO provider "Provider=OraOLEDB.Oracle;".


I have tried adding the data to the variants to the Recordset Addnew; and then tried Recordset AddNew not adding the BLOB data, AppendChunk after the Addnew (see below brief sample code).

Both of these methods casue a leak, it is not dependent of the size of the BLOB data added, i.e. larger BLOB data size same amount of leak per AddNew. I think it might be the BLOB locator being returned. Remove the BLOB data no leak.

So can you AddNew to a Recordset with UpdateBatch for tables that have BLOB data.

Bit of a long post. But does anyone see anything wrong with the approach or know of known problems in this area.

Russell Unsworth


Sample code:

VARIANT* pField;
VARIANT* pData;

// Data added to variants accordingly.
// No BLOB data added to the variant, i.e. it is left at database default NULL.

HREULT hr = pRecordset->AddNew(vFieldList, vValueList);


hr = pRecordset->get_Fields(&pFields);


// Get the field for the BLOB data.
variantt varField;
varField.vt = VT_I4;
hr = pFields->get_Item(varField, &pField);


variantt var;
var.vt = VT_ARRAY|VT_UI1;
var.parray = ::SafeArrayCreateVector(VT_UI1, 0, 100);

hr = pField->AppendChunk(var);
pField->Release();
pFields->Release();

hr = pRecordset->Update(vtMissing, vtMissing);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2005
Added on Sep 6 2005
0 comments
2,296 views