Esempio n. 1
0
// Close the LOB.
func (lv *ExternalLobVar) Close() error {
	if err := lv.Verify(); err != nil {
		return err
	}
	// Py_BEGIN_ALLOW_THREADS
	return lv.lobVar.environment.CheckStatus(
		C.OCILobClose(lv.lobVar.connection.handle,
			lv.lobVar.environment.errorHandle,
			(*C.OCILobLocator)(unsafe.Pointer(&lv.lobVar.dataBytes[lv.pos*lv.lobVar.size]))),
		"LobClose")
	// Py_END_ALLOW_THREADS
}
Esempio n. 2
0
// Close the LOB.
func (lv *ExternalLobVar) Close() error {
	if err := lv.Verify(); err != nil {
		return err
	}
	// Py_BEGIN_ALLOW_THREADS
	if CTrace {
		ctrace("OCILobFileClose(conn=%p, lob=%x)",
			lv.lobVar.connection.handle, lv.getHandleBytes())
	}
	return lv.lobVar.environment.CheckStatus(
		C.OCILobClose(lv.lobVar.connection.handle,
			lv.lobVar.environment.errorHandle,
			lv.getHandle()),
		"LobClose")
	// Py_END_ALLOW_THREADS
}
Esempio n. 3
0
func lobClose(ses *Ses, lob *C.OCILobLocator) error {
	if lob == nil {
		return nil
	}
	//Log.Infof("OCILobClose %p\n%s", lob, getStack(1))
	r := C.OCILobClose(
		ses.ocisvcctx,      //OCISvcCtx          *svchp,
		ses.srv.env.ocierr, //OCIError           *errhp,
		lob,                //OCILobLocator      *locp,
	)
	C.OCIDescriptorFree(unsafe.Pointer(lob), //void     *descp,
		C.OCI_DTYPE_LOB) //ub4      type );
	if r == C.OCI_ERROR {
		return ses.srv.env.ociError()
	}
	return nil
}