I use ODAC for inserting spatial data to oracle database:
TOraType *OraType = new TOraType( q->Session->OCISvcCtx,"MDSYS.SDO_GEOMETRY");
TOraObject *OraObject = new TOraObject( OraType );
Next I fill all required parameters:
OraObject->AttrAsInteger["SDO_GTYPE"] = .....
OraObject->AttrAsInteger["SDO_SRID"] = .....
and coordinates:
OraObject->AttrAsObject["SDO_POINT"]->AttrAsFloat["X"] = ......
OraObject->AttrAsObject["SDO_POINT"]->AttrAsFloat["Y"] = ......
I send to database:
q->SQL->Clear();
q->SQL->Add( );
q->ParamByName()->AsObject = OraObject;
After sending data to database I release memory in that way:
q->ParamByName()->AsObject->FreeObject( true );
OraObject->FreeObject( true );
delete OraType;
Everyting works fine, I mean data are properly inserted to database.
Problem is during disconnect session:
sSession->Disconnect();
I receive error:
"TOraType.Free RefCount = 0 (D:\Projects\Delphi\Dac\Common\Source\MemData.pas, line 7856)"
and session is still connected.
I tryed to cach it and it's ok, but when I close the application I receive that error again and appliaction is crashing with Access violation.
I suppose, no, I'm sure