I've been having an issue that only seems to happen with datasets containing XMLType data. The assert shows up as:
TFreedObject.Free RefCount = -2139062144 (C:\D7\Added\Odac\Lib\MemData.pas, line 7813)
It may only happen when the TOraQuery is in disconnected mode and is later freed. I'm using 6.80.0.48 with D2009, OCIUnicode on.
Is that enough to go on? I've been trying to create a repeatable test case, but haven't managed to yet.
Thanks for any suggestion!
-Mark
Occasional AV or assert error related to XMLType
Here's an example of the problem using a static xmltype field. I also get the same error with SDO_Geometry (which also doesn't appear to work at all with disconnected mode so you need to free the query before reading the data again after disconnecting.) Basically if you just run a query, disconnect, and then free the query you should see the assert error.
Any comments greatly appreciated!
Any comments greatly appreciated!
Code: Select all
procedure TForm1.FullTestButtonClick(Sender: TObject);
var
OraSession: TOraSession;
OraQuery: TOraQuery;
sql: string;
x: string;
i: Integer;
begin
Memo1.Lines.Clear;
Screen.Cursor := crHourglass;
OraCall.OCIUnicode := True;
OraSession := TOraSession.Create(nil);
OraSession.ConnectPrompt := False;
OraSession.AutoCommit := False;
OraSession.ThreadSafety := True;
OraSession.Options.DisconnectedMode := False;
OraSession.Options.UseUnicode := True;
OraQuery := TOraQuery.Create(nil);
OraQuery.Session := OraSession;
OraQuery.Disconnected := True;
OraSession.Username := 'scott';
OraSession.Password := 'tiger';
OraSession.Server := 'mfms3';
OraSession.Connect;
sql := 'select xmlelement("node", ''data'') "Test" from dual';
Memo1.Lines.Add(sql);
Memo1.Lines.Add('');
OraQuery.SQL.Text := sql;
OraQuery.Execute;
Memo1.Lines.Add('First run through all records');
while not OraQuery.eof do
begin
for i := 0 to OraQuery.FieldCount - 1 do
begin
x := OraQuery.Fields[i].AsString;
Memo1.Lines.Add(x);
end;
OraQuery.Next;
end;
Memo1.Lines.Add('');
OraSession.Disconnect;
Memo1.Lines.Add('Disconnected');
Memo1.Lines.Add('');
OraQuery.First;
Memo1.Lines.Add('Second run through all records after disconnect to see it it works.');
while not OraQuery.eof do
begin
for i := 0 to OraQuery.FieldCount - 1 do
begin
x := OraQuery.Fields[i].AsString;
Memo1.Lines.Add(x);
end;
OraQuery.Next;
end;
Memo1.Lines.Add('');
// Will error on free with any XMLType query.
OraQuery.Free;
OraSession.Free;
Screen.Cursor := crDefault;
end;
Unfortunately I can't use the TOraSession DisconnectedMode property as it is not threadsafe (http://www.devart.com/forums/viewtopic.php?t=14723).
Are there any plans to either make the TOraSession disconnected option threadsafe, or alternately to support all types in the dataset disconnected mode?
-Mark
Are there any plans to either make the TOraSession disconnected option threadsafe, or alternately to support all types in the dataset disconnected mode?
-Mark