void _cursorResize(sessionInfo *session, ORACLE_SQL_CURSOR *cursor, size_t size)
{	
	/*
	 because of the way OD_Set_SQL_in_cursor works,
	 [substitutions, isByName, names] can be larger than other members at this point
	 */
	
	size_t oldSize = cursor->substitutions.size();
	
	if(size < oldSize)
	{//we need to release own created objects 
		for(unsigned int i = size; i < oldSize; ++i)
		{
			PA_YieldAbsolute();
			if(cursor->isObjectValid.at(i))
			{
				for(unsigned j = 0; j < cursor->isObjectElementValid.at(i).size(); ++j)
				{
					if(cursor->isObjectElementValid.at(i).at(j))
						OCIObjectFree(session->envhp, session->errhp, cursor->arrayOfTexts.at(i).at(j), OCI_OBJECTFREE_FORCE);	
				}
				
			}
			
			if(cursor->isRawObjectValid.at(i))			
				PA_UnlockHandle(cursor->blobs.at(i));

//			if(cursor->isLocatorValid.at(i))			
//				OCIDescriptorFree(cursor->locators.at(i), OCI_DTYPE_LOB);
			
		}
				
	}

	cursor->substitutions.resize(size);
	cursor->pointers.resize(size);
	cursor->pointers.resize(size);
	cursor->isTowardsSQL.resize(size);	
//	cursor->isByName.resize(size);	
	cursor->indicators.resize(size);	
	cursor->names.resize(size);	
	cursor->binds.resize(size);
	cursor->defines.resize(size);		
	cursor->dates.resize(size);	
	cursor->numbers.resize(size);
	cursor->texts.resize(size);
	cursor->blobs.resize(size);	
//	cursor->blobLengths.resize(size);
	cursor->bytes.resize(size);	
//	cursor->locators.resize(size);	
	cursor->isObjectElementValid.resize(size);	
	cursor->isObjectValid.resize(size);
	cursor->isRawObjectValid.resize(size);
//	cursor->isLocatorValid.resize(size);
	cursor->arrayOfDates.resize(size);	
	cursor->arrayOfNumbers.resize(size);	
	cursor->arrayOfTexts.resize(size);
	cursor->indicatorLists.resize(size);	
	cursor->lengths.resize(size);
}
Ejemplo n.º 2
0
void OWConnection::DestroyType( OCIArray** phData )
{
    CheckError( OCIObjectFree(
        hEnv,
        hError,
        (OCIColl*) *phData,
        (ub2) 0), NULL );
}
Ejemplo n.º 3
0
void OWConnection::DestroyType( sdo_geometry** pphData )
{
    CheckError( OCIObjectFree(
        hEnv,
        hError,
        (dvoid*) *pphData,
        (ub2) 0), NULL );
}
Ejemplo n.º 4
0
//-----------------------------------------------------------------------------
// ObjectVar_Finalize()
//   Prepare for variable destruction.
//-----------------------------------------------------------------------------
static void ObjectVar_Finalize(
    udt_ObjectVar *self)                // variable to free
{
    int i;

    for (i = 0; i < self->allocatedElements; i++) {
        if (self->data[i])
            OCIObjectFree(self->environment->handle,
                    self->environment->errorHandle, self->data[i],
                    OCI_OBJECTFREE_FORCE);
    }
    Py_DECREF(self->connection);
    Py_XDECREF(self->objectType);
    if (self->objectIndicator)
        PyMem_Free(self->objectIndicator);
}
Ejemplo n.º 5
0
sword OCI_OCIObjectFree
(
    OCIEnv   *env,
    OCIError *err,
    dvoid    *instance,
    ub2       flags
)
{
    sword ret = OCI_SUCCESS;

    if (instance)
    {
        OCI_MUTEXED_CALL(OCILib.nb_objinst--)

        ret = OCIObjectFree(env, err, instance, flags);
    }

    return ret;
}