3 Replies Latest reply on Jun 4, 2002 2:17 PM by 262055

    Memory Leak using OO4O in Visual Basic

    262055
      The following code is for the most part taken from the example that comes with oracle8i client.

      Set OraSession = CreateObject("OracleInProcServer.XOraSession")
      Set OraDatabase = OraSession.OpenDatabase(TestDbName, TestDbUsername & "/" & TestDbPassword, 0&)
      OraDatabase.Parameters.Add "BlobData", Null, ORAPARM_OUTPUT
      OraDatabase.Parameters("BlobData").serverType = ORATYPE_BLOB
      OraSession.BeginTrans
      OraDatabase.ExecuteSQL ("BEGIN select blob_data into :BLOBDATA from BLOBTEST_DATA where LOB_ID = 1 for update NOWAIT; END;")
      Set WriteBlob = OraDatabase.Parameters("BlobData").Value
      FNum = FreeFile
      Open FileName For Binary As #FNum
      FileSize = LOF(FNum)
      ReDim buffer(FileSize)
      Get #FNum, , buffer
      amount_written = WriteBlob.Write(buffer)
      Close FNum
      OraSession.CommitTrans
      ReDim buffer(0)
      Set WriteBlob = Nothing
      Set OraDatabase = Nothing
      Set OraSession = Nothing

      The application is used to read data from file and write it to a BLOB field in database.
      Even though the file is closed, the buffer is reset and the blob, database and session objects are destroyed, the application does not seam to release the memory. After several consecutive tests, the application consumes all memory.

      Currently using OO4O version: 8.1.6.3.6
      My question is: is there a patch or fix for a this version and/or can anyone recommend any other version of OO4O that does not have this problem?

      thank you,

      Sergey