mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-17 14:21:39 +00:00
Tidy up of UserTransaction roll back on throwable as opposed to Exception
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2218 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,6 +40,8 @@ import org.alfresco.service.transaction.TransactionService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.sun.star.uno.RuntimeException;
|
||||
|
||||
/**
|
||||
* Alfresco Authenticator Class
|
||||
*
|
||||
@@ -351,7 +353,7 @@ public class AlfrescoAuthenticator extends SrvAuthenticator
|
||||
client.setHomeFolder( homeSpaceRef);
|
||||
tx.commit();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Throwable ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -359,7 +361,16 @@ public class AlfrescoAuthenticator extends SrvAuthenticator
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
logger.error("Failed to rollback transaction", ex);
|
||||
logger.error("Failed to rollback transaction", ex2);
|
||||
}
|
||||
|
||||
if(ex instanceof RuntimeException)
|
||||
{
|
||||
throw (RuntimeException)ex;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new RuntimeException("Failed to get home folder", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -135,7 +135,11 @@ public class RepositoryAuthenticationDao implements MutableAuthenticationDao
|
||||
sp.addStore(getUserStoreRef());
|
||||
sp.excludeDataInTheCurrentTransaction(false);
|
||||
|
||||
ResultSet rs = searchService.query(sp);
|
||||
ResultSet rs = null;
|
||||
|
||||
try
|
||||
{
|
||||
rs = searchService.query(sp);
|
||||
|
||||
for (ResultSetRow row : rs)
|
||||
{
|
||||
@@ -151,6 +155,14 @@ public class RepositoryAuthenticationDao implements MutableAuthenticationDao
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (rs != null)
|
||||
{
|
||||
rs.close();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@@ -134,7 +134,11 @@ public class PersonServiceImpl implements PersonService
|
||||
sp.addStore(storeRef);
|
||||
sp.excludeDataInTheCurrentTransaction(false);
|
||||
|
||||
ResultSet rs = searchService.query(sp);
|
||||
ResultSet rs = null;
|
||||
|
||||
try
|
||||
{
|
||||
rs = searchService.query(sp);
|
||||
|
||||
for (ResultSetRow row : rs)
|
||||
{
|
||||
@@ -151,6 +155,14 @@ public class PersonServiceImpl implements PersonService
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (rs != null)
|
||||
{
|
||||
rs.close();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -287,9 +299,14 @@ public class PersonServiceImpl implements PersonService
|
||||
sp.addStore(storeRef);
|
||||
sp.excludeDataInTheCurrentTransaction(false);
|
||||
|
||||
ResultSet rs = searchService.query(sp);
|
||||
|
||||
HashSet<NodeRef> nodes = new HashSet<NodeRef>();
|
||||
ResultSet rs = null;
|
||||
|
||||
try
|
||||
{
|
||||
rs = searchService.query(sp);
|
||||
|
||||
|
||||
for (ResultSetRow row : rs)
|
||||
{
|
||||
|
||||
@@ -299,7 +316,14 @@ public class PersonServiceImpl implements PersonService
|
||||
nodes.add(nodeRef);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (rs != null)
|
||||
{
|
||||
rs.close();
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user