|
From: Bob K. <bob...@us...> - 2004-10-21 07:15:34
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8359/src/hk/hku/cecid/phoenix/message/handler Modified Files: MessageServer.java Log Message: Fix the problem on backup/restore, which fail to restore on backup because the same ZipInputStream is used in message repository and object store. Solve the problem by using the different ZipInputStream for message repository and object store. Index: MessageServer.java =================================================================== RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/handler/MessageServer.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** MessageServer.java 12 Jul 2004 09:24:43 -0000 1.152 --- MessageServer.java 21 Oct 2004 07:15:23 -0000 1.153 *************** *** 924,928 **** final Connection connection = dbConnectionPool.getConnection(); ! final ZipInputStream zis; try { zis = new ZipInputStream(new FileInputStream(backupFile)); --- 924,928 ---- final Connection connection = dbConnectionPool.getConnection(); ! ZipInputStream zis; try { zis = new ZipInputStream(new FileInputStream(backupFile)); *************** *** 970,973 **** --- 970,984 ---- = (BackupablePersistenceHandler) objectStoreHandler; backupObjectStoreHandler.setBackupDirectory(SEPARATOR_OBJECT_STORE); + zis.close(); + try { + zis = new ZipInputStream(new FileInputStream(backupFile)); + } catch (FileNotFoundException fnfe) { + dbConnectionPool.freeConnection(connection, true); + String err = ErrorMessages.getMessage( + ErrorMessages.ERR_HERMES_FILE_IO_ERROR, fnfe, + backupFile); + logger.error(err); + throw new MessageServerException(err); + } backupObjectStoreHandler.restore(zis); } catch (IOException ioe) { *************** *** 976,983 **** exception = ioe; } finally { ! try { ! zis.close(); ! } catch (IOException ioe) {} ! if (exception != null) { throw new MessageServerException(exception.getMessage()); --- 987,995 ---- exception = ioe; } finally { ! if (zis != null) { ! try { ! zis.close(); ! } catch (IOException ioe) {} ! } if (exception != null) { throw new MessageServerException(exception.getMessage()); |