db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunitha Kambhampati (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1466) Network Server should flush the PrintWriter after console output
Date Fri, 14 Jul 2006 22:42:15 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1466?page=all ]

Sunitha Kambhampati updated DERBY-1466:

    Attachment: derby1466.diff.txt

Thanks to everyone who responded on this issue.

I am attaching a patch 'derby1466.diff.txt' and corresponding 'derby1466.stat.txt' which uses
approach 1 to autoflush the data written to the console. 

This patch does
-- wrap the printwriter that the user's uses with another printwriter with autoflush as true.
This will ensure that data will be flushed at println calls. Also, exception.printStackTrace(writer)
will also flush data to the writer correctly. 

-- There is a prexisting test - DerbyNetNewserver.java that is meant to test the
Test NetworkServerControl.start(PrintWriter) call.  In the test, the user is passing a printwriter,
that has autoflush=true. 

>From looking at this test, it seemed to me that the original intent was to have user specify
the autoflush=true option when using the NetworkServerControl.start(PrintWriter) call. 

Now with DERBY-1466, we want all messages to be flushed by default, so I have made changes
to this test to pass a PrintWriter without autoflush=true. 

derbynetclientmats and derbynetmats ran fine on ibm142/linux.  My derbyall is currently running.

Can someone please review.  Thanks.

> Network Server should flush the PrintWriter after console output
> ----------------------------------------------------------------
>                 Key: DERBY-1466
>                 URL: http://issues.apache.org/jira/browse/DERBY-1466
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions:
>            Reporter: Kathey Marsden
>         Attachments: derby1466.diff.txt, derby1466.stat.txt
> If Network Server is started with a PrintWriter specified for console output it will
not automatically flush output such as  starting the server.  This can be confusing as the
console output shows no activity.
> Users currently need to specify the PrintWriter to autoflush  e.g.
>  starterWriter = new PrintWriter(new FileOutputStream(new File(SERVER_START_LOG)),true);

> derbyServer = new NetworkServerControl();
>  derbyServer.start(starterWriter); 
> For repro see:
> http://www.nabble.com/Questions-about-Network-Server-API-Behavior-p5055814.html
> And change the following line in the program to not autoflush as follows:
> starterWriter = new PrintWriter(new FileOutputStream(new File(SERVER_START_LOG)),false);

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message