Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes Oracle occi have any memory bugs when writing blobs using stored procedures via stream?
    primarykey
    data
    text
    <p>The function below will produce some kind of memory corruption that will cause an exception (which cannot be identified since memory is corrupted) while doing another call:</p> <pre><code>{ ora::Statement stmt(__cn); string sql("BEGIN Pckg.Sp_procA(:1, :2, :3, :4, :5, :6, :7, :8, " ":9, :10, :11, :12, :13, :14, :15, :payload); END;"); occi::Blob payload(__cn.getConnection()); occi::Environment* tempEnv = occi::Environment::createEnvironment(); occi::Timestamp reportTime(tempEnv); reportTime.fromText(__report.report_time), "yyyy-mm-ddH24:mi:ss.ff"); stmt.setSQL(sql); stmt.setString (1, ""); stmt.setString (2, ""); stmt.setString (3, __report.varA); stmt.setString (4, __report.varB); stmt.setInt (5, __report.varC); stmt.setString (6, __report.varD); stmt.setString (7, __report.varE); stmt.setString (8, __report.varF); stmt.setTimestamp(9, reportTime); stmt.setNull (10, occi::OCCITIMESTAMP); stmt.setString (11, __report.varG); stmt.setString (12, __report.varH); stmt.setString (13, __report.varI); stmt.setString (14, __report.varK); stmt.setString (15, __report.varX); stmt.setBinaryStreamMode(16, __report.payload.Size(), true); stmt.executeUpdate(); occi::Stream* streamedData = stmt.getStream(16); streamedData-&gt;writeLastBuffer(__report.payload.GetPtr(), __report.payload.Size()); stmt.closeStream(streamedData); occi::Environment::terminateEnvironment(tempEnv); return true; } </code></pre> <p>The function below works perfectly unless the code above is executed and looks like this:</p> <pre><code>{ ora::Statement stmt(__cn); string sql("BEGIN " "Pckg.Sp_procB(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11); END;"); occi::Environment* tempEnv = occi::Environment::createEnvironment(); occi::Timestamp reportTime(tempEnv); reportTime.fromText(__report.report_time, "yyyy-mm-dd HH24:mi:ss.ff"); stmt.setSQL(sql); stmt.setString (1, ""); stmt.setString (2, ""); stmt.setString (3, __report.varA); stmt.setString (4, __report.varB); stmt.setInt (5, __report.varB); stmt.setString (6, __report.varD); stmt.setString (7, __report.varE); stmt.setString (8, __report.varF); stmt.setString (9, __report.varG); stmt.setTimestamp(10, reportTime); stmt.setNull (11, occi::OCCITIMESTAMP); stmt.executeUpdate(); occi::Environment::terminateEnvironment(tempEnv); return true; </code></pre> <p>}</p> <p>I got the blob insert example from Oracle's documentation and can't see anything wrong with it. The second function also seems to be ok which got me thinking that Oracle's occi might have some kind of bug that corrupts memory. Anyone knows anything about this or has done anything similar?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload