OracleConnection::OracleConnection( OracleEnvironment &rEnv ) :
	fStatus( eUnitialized ), fOracleEnv( rEnv ), fErrhp(), fSrvhp(), fSvchp(), fUsrhp()
{
	StartTrace(OracleConnection.OracleConnection);

	// ---
	if ( AllocateHandle( fErrhp ) /* alloc error handle */
		 && AllocateHandle( fSvchp ) /* alloc service context handle */
		 && AllocateHandle( fSrvhp ) /* alloc server connection handle */
		 && AllocateHandle( fUsrhp ) /* alloc user session handle */
	   ) {
		fStatus = eHandlesAllocated;
	}
}
bool HighLevelReaderThatReadsChunks::readNextChunk()
{
    // Allocate new a chunk of data.
    MAHandle chunk = AllocateHandle();
    int result = maCreateData(chunk, mDataChunkSize);
    if (RES_OUT_OF_MEMORY == result)
    {
        return false;
    }
    else
    {
        // Start reading into the new chunk.
        mDataChunks.add(chunk);
        mDataChunkOffset = 0;
        mConnection->recvToData(chunk, mDataChunkOffset, mDataChunkSize);
        return true;
    }
}