final boolean updateDependencies = MigrationUtils.getProperty(this, MigrationStateKeys.UPDATE_DEPENDENCIES, Boolean.TRUE);
File temporaryTg = exportCurrentTgAsTemporaryFile(session, monitor);
- if (temporaryTg != null)
- setProperty(MigrationStateKeys.CURRENT_TGS, initializeTransferableGraphSource(temporaryTg));
+ if (temporaryTg != null) {
+ TransferableGraphSource tgs = (TransferableGraphSource)properties.get(MigrationStateKeys.CURRENT_TGS);
+ if (tgs != null)
+ try {
+ tgs.close();
+ } catch (IOException e) {
+ Logger.defaultLogError(e);
+ }
+ setProperty(MigrationStateKeys.CURRENT_TGS, initializeTransferableGraphSource(temporaryTg, true));
+ }
TransferableGraphSource tgs = getProperty(MigrationStateKeys.CURRENT_TGS);
if (tgs != null) {
}
private TransferableGraphSource initializeTransferableGraphSource(File dataContainer) throws DatabaseException {
+ return initializeTransferableGraphSource(dataContainer, false);
+ }
+ private TransferableGraphSource initializeTransferableGraphSource(File dataContainer, boolean deleteOnClose) throws DatabaseException {
try {
- StreamingTransferableGraphFileReader reader = new StreamingTransferableGraphFileReader(dataContainer);
+ StreamingTransferableGraphFileReader reader = new StreamingTransferableGraphFileReader(dataContainer, deleteOnClose);
TransferableGraphSource tgs = reader.readTG();
setProperty(MigrationStateKeys.CURRENT_TGS_READER, reader);
setProperty(MigrationStateKeys.CURRENT_TGS, tgs);