Commit transactions between open/create and close file when returning/storing files via FTP.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3517 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-08-15 14:44:17 +00:00
parent 8980c9f069
commit b29838ab8f
2 changed files with 66 additions and 2 deletions

View File

@@ -568,6 +568,22 @@ public class FTPDataSession extends SrvSession implements Runnable
netFile = disk.openFile( this, tree, params); 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 // Check if the file has been opened
if (netFile == null) if (netFile == null)
@@ -776,6 +792,22 @@ public class FTPDataSession extends SrvSession implements Runnable
netFile = disk.createFile(this, tree, params); 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 // Notify change listeners that a new file has been created
DiskDeviceContext diskCtx = (DiskDeviceContext) tree.getContext(); DiskDeviceContext diskCtx = (DiskDeviceContext) tree.getContext();

View File

@@ -1839,7 +1839,23 @@ public class FTPSrvSession extends SrvSession implements Runnable
netFile = disk.openFile(this, tree, params); 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 // Check if the file has been opened
if (netFile == null) if (netFile == null)
@@ -1898,7 +1914,7 @@ public class FTPSrvSession extends SrvSession implements Runnable
m_dataSess = null; m_dataSess = null;
// Close the network file // Close the network file
disk.closeFile(this, tree, netFile); disk.closeFile(this, tree, netFile);
netFile = null; netFile = null;
@@ -2078,6 +2094,22 @@ public class FTPSrvSession extends SrvSession implements Runnable
netFile = disk.createFile(this, tree, params); 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 // Notify change listeners that a new file has been created
DiskDeviceContext diskCtx = (DiskDeviceContext) tree.getContext(); DiskDeviceContext diskCtx = (DiskDeviceContext) tree.getContext();