db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davi...@apache.org
Subject svn commit: r422826 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
Date Mon, 17 Jul 2006 20:01:40 GMT
Author: davidvc
Date: Mon Jul 17 13:01:38 2006
New Revision: 422826

URL: http://svn.apache.org/viewvc?rev=422826&view=rev
Log:
DERBY-1466: Network Server should flush the PrintWriter after console output
Contributed by Sunitha Kambhampati.


Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=422826&r1=422825&r2=422826&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Mon Jul 17 13:01:38 2006
@@ -403,7 +403,14 @@
 	 */
 	public void setLogWriter(PrintWriter outWriter)
 	{
-		logWriter = outWriter;
+        // wrap the user-set outWriter with, autoflush to true.
+        // this will ensure that messages to console will be 
+        // written out to the outWriter on a println.
+        // DERBY-1466
+        if ( outWriter != null )
+            logWriter = new PrintWriter(outWriter,true);
+        else
+            logWriter = outWriter;
     }
 
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java?rev=422826&r1=422825&r2=422826&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java Mon
Jul 17 13:01:38 2006
@@ -63,7 +63,15 @@
 	{
 		this.listenAddress = listenAddress;
 		this.portNumber = portNumber;
-		this.consoleWriter = consoleWriter;
+
+        // wrap the user-set consoleWriter with autoflush to true.
+        // this will ensure that messages to console will be 
+        // written out to the consoleWriter on a println.
+        // DERBY-1466
+        if (consoleWriter != null)
+            this.consoleWriter = new PrintWriter(consoleWriter,true);
+        else
+            this.consoleWriter = consoleWriter;
 	}
 
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java?rev=422826&r1=422825&r2=422826&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
Mon Jul 17 13:01:38 2006
@@ -99,7 +99,10 @@
         if( bos != null)
 		{
             bos.reset();
-			writer = new PrintWriter(bos,true);        
+            // DERBY-1466, Test that messages are flushed to the
+            // writer irrespective of whether the user's writer is
+            // set to autoflush true.
+            writer = new PrintWriter(bos); 
 		}
 		server.start(writer);
         Connection conn = null;



Mime
View raw message