protected void writeExistingData() throws IOException {
// start with blank schema - SET SCHEMA to log
currentSession.loggedSchema = null;
Iterator schemas = database.schemaManager.allSchemaNameIterator();
while (schemas.hasNext()) {
String schema = (String) schemas.next();
Iterator tables =
database.schemaManager.databaseObjectIterator(schema,
SchemaObject.TABLE);
while (tables.hasNext()) {
Table t = (Table) tables.next();
// write all memory table data
// write cached table data unless index roots have been written
// write all text table data apart from readonly text tables
// unless index roots have been written