Issue 24713: Speed up create.database & import.sampledata
authorStefan Hühner <stefan.huehner@openbravo.com>
Fri, 06 Sep 2013 12:26:06 +0200
changeset 464 621081475315
parent 463 64ee18562b3a
child 465 21dd58e127a8
Issue 24713: Speed up create.database & import.sampledata
Speed up those actions by using more jdbc batching for
creation of foreign keys and for drop/create of check constraints
src/org/apache/ddlutils/platform/PlatformImplBase.java
--- a/src/org/apache/ddlutils/platform/PlatformImplBase.java	Fri Sep 06 11:30:25 2013 +0200
+++ b/src/org/apache/ddlutils/platform/PlatformImplBase.java	Fri Sep 06 12:26:06 2013 +0200
@@ -742,7 +742,7 @@
       getSqlBuilder().setWriter(buffer);
       getSqlBuilder().createExternalForeignKeys(model);
       sql = buffer.toString();
-      evaluateBatch(connection, sql, continueOnError);
+      evaluateBatchRealBatch(connection, sql, continueOnError);
     } catch (IOException e) {
       // won't happen because we're using a string writer
     }
@@ -3297,7 +3297,7 @@
           getSqlBuilder().disableAllChecks(database.getTable(i));
         }
       }
-      evaluateBatch(connection, buffer.toString(), true);
+      evaluateBatchRealBatch(connection, buffer.toString(), true);
     } catch (Exception e) {
       e.printStackTrace();
     }
@@ -3395,7 +3395,7 @@
           getSqlBuilder().enableAllChecks(table);
         }
       }
-      evaluateBatch(connection, buffer.toString(), true);
+      evaluateBatchRealBatch(connection, buffer.toString(), true);
     } catch (Exception e) {
       e.printStackTrace();
     }