From 79d3469f726eb06deb728befbc61bd46b713f533 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 25 Jul 2008 16:06:32 +0000 Subject: [PATCH] FR [ 1829798 ] Easy generation of migration scripts Generate different names for different sessions --- base/src/org/compiere/dbPort/Convert.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/base/src/org/compiere/dbPort/Convert.java b/base/src/org/compiere/dbPort/Convert.java index c507de1aa6..2fad7e062b 100644 --- a/base/src/org/compiere/dbPort/Convert.java +++ b/base/src/org/compiere/dbPort/Convert.java @@ -17,6 +17,7 @@ package org.compiere.dbPort; import java.io.DataOutputStream; +import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.sql.Connection; @@ -422,9 +423,7 @@ public abstract class Convert // migration_script_oracle.sql and migration_script_postgresql.sql try { if (tempFileOr == null) { - String fileNameOr = System.getProperty("java.io.tmpdir") - + System.getProperty("file.separator") - + "migration_script_oracle.sql"; + File fileNameOr = File.createTempFile("migration_script_", "_oracle.sql"); tempFileOr = new FileOutputStream(fileNameOr, true); osOr = new DataOutputStream(tempFileOr); } @@ -440,9 +439,7 @@ public abstract class Convert pgStatement = r[0]; } if (tempFilePg == null) { - String fileNamePg = System.getProperty("java.io.tmpdir") - + System.getProperty("file.separator") - + "migration_script_postgresql.sql"; + File fileNamePg = File.createTempFile("migration_script_", "_postgresql.sql"); tempFilePg = new FileOutputStream(fileNamePg, true); osPg = new DataOutputStream(tempFilePg); }