Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0 Beta 10
-
None
-
any
Description
"..\migrate" tool has some problem with printing currently executed messages into log.
As described in code below, System.out is wrapped into PrintWriter which, most possibly, buffers output data.
So, if it takes a lot of time to execute single query, and if it is a lot of queries to be executed, behaviour of "..\migate"
tool will be _a_bit_ unsuccessful. It will print all logs, sure, but I won't see them because they are buffered.
Please add flush() call as described below.
Here is some related code:
private PrintWriter logWriter = new PrintWriter(System.out);
........
private StringBuffer handleLine(StringBuffer command, String line) throws SQLException, UnsupportedEncodingException {
String trimmedLine = line.trim();
if (lineIsComment(trimmedLine))
else if (commandReadyToExecute(trimmedLine))
{ command.append(line.substring(0, line.lastIndexOf(delimiter))); command.append(LINE_SEPARATOR); println(command); <<<<<< please add "flush();" call here <<<<<<<<<<< executeStatement(command.toString()); command.setLength(0); }else if (trimmedLine.length() > 0)
{ command.append(line); command.append(LINE_SEPARATOR); } return command;
}
...........
private void println(Object o) {
if (logWriter != null)
}
.................
private void flush() {
if (logWriter != null)
if (errorLogWriter != null)
{ errorLogWriter.flush(); }}