I want do dump a master detail table into an XML structure. Table master has 20.000 records, tabledetail has 120 records each. Using a cursor to retrieve the master recs and a criteria to get the details, I tried to walk thru the data., However, I ran into memory issues (out of memory). The data (about 200 bytes each rec) gets dumped into a TStreamWriter and a file, but the problem persits if I dump only the masters data.
Additionally perfomance is quite poor, because every cursor.next issues a new sql statement. When I changed retrieving the data to use a TCriteria to get the whole table as a List, I have no memory problems. The app is not leaking memory, so I assume that usinga cursor somehow uses memory.
Does this make sense? It is possible, that using a cursor uses all that memory? Or is the TStreamWrite allocating memory?
tx for an answer!