OracleSessionPool, AV while destroying datamodule

ldsandon

Member³
I am getting AVs while destroying a datamodule with a session pool component on it - it started giving me AVs when I added the pool. Is there any issue to be aware of while destroying a pool - i.e. or session must be logged out - ?
 
I'm not aware of any problem. When a session pool is destroyed, it will disconnect all sessions that are connected through the pool.

If you have a little project that reproduces this, please send it to me.
 
I will try to reproduce it in a small test case, by now I found - looking at the CPU window - that the AV occurs in TOracleSessionPool.Release, I think when it calls TOracleSessionPool.GetEntry, but looking at machine code is a bit difficult to undertand why.
 
I have additional infos, it looks to be a strange bug.

I was trying to parse an XML file (which holds a "master" and "detail" records") and write it to a database. First I tried using Datasmap and XMLTransforms, then did it manually because the XML transformations have problems with more than one nested dataset.

I wrote something like this to process XML subnodes (mapping them to detail tables):

Code:
SubNode := MailNode.ChildNodes.FindNode('ATTACHMENTS');
if (SubNode <> nil) and SubNode.HasChildNodes then
begin
  for j := 0 to SubNode.ChildNodes.Count -1 do
  begin
    dsAttachments.Insert;
    dsAttachmentsCONTENT_TYPE.AsVariant := SubNode.ChildNodes[j]['CONTENT_TYPE'];
    dsAttachmentsFILENAME.AsVariant := SubNode.ChildNodes[j]['FILE'];
    dsAttachmentsELEMENT_ID.AsVariant := SubNode.ChildNodes[j]['ELEMENT_ID'];
    dsAttachments.Post;
  end;
end;
I was using TOracleDataset because I used them before with Datasnap, they were set for a M/D relationship therefore I relied on them to generate PKs (using sequences) and FKs (using the M/D relationship).

I discovered that sometimes - not always - when calling Post an "Index list out of bound (-2)" exception was raised, and from now on attempting to close the TOracleSession used by that dataset would result in an AV.

When I got rid of all the dataset and rewrote it to use plain TOracleQuery components, the error disappeared. Yet I wonder why it appeared, because the logic it's the same, the difference is now I don't rely on components to generate and set PKs and FKs but do it myself in code.
 
Do you know where the "list index out of bounds" occurred? Was it is your own code or in a Direct Oracle Access unit?
 
The exception is raised when I call TOracleDataset.Post, and it looks to happen in DOA code, but I do not have the sources thus I can't check where it really happens. NOw I rewrote everything to avoid this error, but I could get the old code from CVS and send to you.
 
Back
Top