From 7bd656484e30b00da0498c88a78d357ead459d56 Mon Sep 17 00:00:00 2001 From: Gary Spencer Date: Mon, 6 Feb 2006 17:53:22 +0000 Subject: [PATCH] Changed transaction handling in the main request processing loop to use the new method that handles commit and rollback. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2309 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../filesys/smb/server/SMBSrvSession.java | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/source/java/org/alfresco/filesys/smb/server/SMBSrvSession.java b/source/java/org/alfresco/filesys/smb/server/SMBSrvSession.java index 999eecd9db..be1c9ac440 100644 --- a/source/java/org/alfresco/filesys/smb/server/SMBSrvSession.java +++ b/source/java/org/alfresco/filesys/smb/server/SMBSrvSession.java @@ -23,8 +23,6 @@ import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; -import javax.transaction.UserTransaction; - import org.alfresco.filesys.netbios.NetBIOSException; import org.alfresco.filesys.netbios.NetBIOSName; import org.alfresco.filesys.netbios.NetBIOSPacket; @@ -53,7 +51,6 @@ import org.alfresco.filesys.smb.server.notify.NotifyRequest; import org.alfresco.filesys.smb.server.notify.NotifyRequestList; import org.alfresco.filesys.util.DataPacker; import org.alfresco.filesys.util.StringList; -import org.alfresco.service.transaction.TransactionService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -1556,22 +1553,20 @@ public class SMBSrvSession extends SrvSession implements Runnable } // end switch session state - // Check for an active transaction, and commit it + // Commit, or rollback, any active user transaction - if ( hasUserTransaction()) + try { - try - { - // Commit the transaction + // Commit or rollback the transaction - UserTransaction trans = getUserTransaction(); - trans.commit(); - } - catch ( Exception ex) - { - // Debug - logger.error("Error committing transaction", ex); - } + endTransaction(); + } + catch ( Exception ex) + { + // Debug + + if ( logger.isDebugEnabled()) + logger.debug("Error committing transaction", ex); } // Give up the CPU