Author: tomdz Date: Mon Aug 29 12:01:13 2005 New Revision: 264616 URL: http://svn.apache.org/viewcvs?rev=264616&view=rev Log: (empty)
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java?rev=264616&r1=264615&r2=264616&view=diff ============================================================================== --- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java (original) +++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java Mon Aug 29 12:01:13 2005 @@ -184,7 +184,22 @@ { try { - getWriter(new BufferedWriter(new FileWriter(filename))).write(model); + BufferedWriter writer = null; + + try + { + writer = new BufferedWriter(new FileWriter(filename)); + + getWriter(writer).write(model); + writer.flush(); + } + finally + { + if (writer != null) + { + writer.close(); + } + } } catch (Exception ex) { @@ -193,7 +208,8 @@ } /** - * Writes the database model to the given output stream. + * Writes the database model to the given output stream. Note that this method + * does not flush the stream. * * @param model The database model * @param output The output stream @@ -211,7 +227,8 @@ } /** - * Writes the database model to the given output writer. + * Writes the database model to the given output writer. Note that this method + * does not flush the writer. * * @param model The database model * @param output The output writer