db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r430539 - in /db/derby/code/branches/10.1/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/jdbc/ testing/org/apache/derbyTesting/functionTests/tests/derbynet/
Date Thu, 10 Aug 2006 21:29:01 GMT
Author: kmarsden
Date: Thu Aug 10 14:29:00 2006
New Revision: 430539

URL: http://svn.apache.org/viewvc?rev=430539&view=rev
Log:
DERBY-1446 Network Server should flush the PrintWriter after console output

merge from trunk (svn 422826)

Contributed by Sunitha Kambhampati


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

Modified: db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=430539&r1=430538&r2=430539&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Thu Aug 10 14:29:00 2006
@@ -394,7 +394,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/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java?rev=430539&r1=430538&r2=430539&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/jdbc/DRDAServerStarter.java
Thu Aug 10 14:29:00 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/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java?rev=430539&r1=430538&r2=430539&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/DerbyNetNewServer.java
Thu Aug 10 14:29:00 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