diff --git a/source/java/org/alfresco/filesys/ftp/FTPDataSession.java b/source/java/org/alfresco/filesys/ftp/FTPDataSession.java index 407b5cbc0f..426ab141f8 100644 --- a/source/java/org/alfresco/filesys/ftp/FTPDataSession.java +++ b/source/java/org/alfresco/filesys/ftp/FTPDataSession.java @@ -568,6 +568,22 @@ public class FTPDataSession extends SrvSession implements Runnable netFile = disk.openFile( this, tree, params); } + // Commit any current transaction + + try + { + // Commit or rollback the transaction + + endTransaction(); + } + catch ( Exception ex) + { + // Debug + + if ( logger.isDebugEnabled()) + logger.debug("Error committing transaction", ex); + } + // Check if the file has been opened if (netFile == null) @@ -776,6 +792,22 @@ public class FTPDataSession extends SrvSession implements Runnable netFile = disk.createFile(this, tree, params); } + // Commit any current transaction + + try + { + // Commit or rollback the transaction + + endTransaction(); + } + catch ( Exception ex) + { + // Debug + + if ( logger.isDebugEnabled()) + logger.debug("Error committing transaction", ex); + } + // Notify change listeners that a new file has been created DiskDeviceContext diskCtx = (DiskDeviceContext) tree.getContext(); diff --git a/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java b/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java index 0b22b83443..3461fb5cfc 100644 --- a/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java +++ b/source/java/org/alfresco/filesys/ftp/FTPSrvSession.java @@ -1839,7 +1839,23 @@ public class FTPSrvSession extends SrvSession implements Runnable netFile = disk.openFile(this, tree, params); } - + + // Commit any current transaction + + try + { + // Commit or rollback the transaction + + endTransaction(); + } + catch ( Exception ex) + { + // Debug + + if ( logger.isDebugEnabled()) + logger.debug("Error committing transaction", ex); + } + // Check if the file has been opened if (netFile == null) @@ -1898,7 +1914,7 @@ public class FTPSrvSession extends SrvSession implements Runnable m_dataSess = null; // Close the network file - + disk.closeFile(this, tree, netFile); netFile = null; @@ -2078,6 +2094,22 @@ public class FTPSrvSession extends SrvSession implements Runnable netFile = disk.createFile(this, tree, params); } + // Commit any current transaction + + try + { + // Commit or rollback the transaction + + endTransaction(); + } + catch ( Exception ex) + { + // Debug + + if ( logger.isDebugEnabled()) + logger.debug("Error committing transaction", ex); + } + // Notify change listeners that a new file has been created DiskDeviceContext diskCtx = (DiskDeviceContext) tree.getContext();