RE: Memory management
RE: Memory management
- Subject: RE: Memory management
- From: Marius Strumyla <email@hidden>
- Date: Tue, 16 Mar 2004 17:19:59 -0500
See below...
Richard Bruch wrote:
> Hi Arturo
>
> here is my code so you can see what goes on. The question is whether there
> is a means to get this code working for large queries.
>
> try
> {
> PrintWriter pw = new PrintWriter(new FileOutputStream(tableName +
> ".dat"));
> EODatabaseChannel dc = dctx.availableChannel();
> ac = dc.adaptorChannel();
> if(!ac.isOpen())
> ac.openChannel();
> ac.evaluateExpression(EOSQLExpression.expressionForString(stmt));
> ac.setAttributesToFetch(ac.describeResults());
> NSDictionary row = null;
> while((row = ac.fetchRow()) != null)
> {
> for(i = 0; i < fieldCount; i ++)
> {
> Object res = row.objectForKey(keys.objectAtIndex(i));
> if(i > 0)
> pw.print('\t');
> if(res != null && res != nullVal)
> pw.print(res);
> }
> pw.println();
Would calling pw.flush() here help a little?
> }
> pw.close();
> }
> catch(Exception e)
> {
> System.out.println("Error occured: " + e);
> try
> {
> if(ac != null)
> ac.cancelFetch();
> }
> catch(Exception xe)
> {
> }
> }
>
> Thank you
>
> Richard
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.