mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
10982: Merged V2.1 to V2.2 10273: Fix for ETWOONE-317: Error from regenerate renditions wizard when templates are updated 10985: Merged V2.1 to V2.2 10717: Fix for ETWOONE-14: System Error message appears while clicking 'Manage Task' icon in ... 10742: Fix for ETWOONE-119: A user created with space characters at the begin and at the end can't login 10758: Fix for ETWOONE-183: URL addressability of forum spaces and topics 10760: Fix for ETWOONE-339: URL Addressability to discussions causes display issue 10761: Fix for ETWOONE-196: Attempt to post to the same forum by two or more users simultaneously leads to error appearance and impossibility to post for some of them 10772: Fix for ETWOONE-225: Validation.js does not properly handle trailing whitespace 10986: Added Hibernate src to Eclipse project 11004: Remove annoying exceptions on shutdown 11005: Minor javadoc fix 11012: Fixed ETWOTWO-423: Optionally inject the Open Office document converter instance to the transformer git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11202 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,6 +28,7 @@ import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.VmShutdownListener;
|
||||
import org.alfresco.util.transaction.SpringAwareUserTransaction;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
@@ -41,6 +42,8 @@ import org.springframework.transaction.TransactionDefinition;
|
||||
*/
|
||||
public class TransactionServiceImpl implements TransactionService
|
||||
{
|
||||
private static VmShutdownListener shutdownListener = new VmShutdownListener("TransactionService");
|
||||
|
||||
private PlatformTransactionManager transactionManager;
|
||||
private int maxRetries = -1;
|
||||
private int minRetryWaitMs = -1;
|
||||
@@ -79,8 +82,20 @@ public class TransactionServiceImpl implements TransactionService
|
||||
|
||||
public boolean isReadOnly()
|
||||
{
|
||||
Boolean allowWrite = (Boolean)sysAdminCache.get(KEY_SYSADMIN_ALLOW_WRITE);
|
||||
return (allowWrite == null ? false : ! allowWrite);
|
||||
if (shutdownListener.isVmShuttingDown())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
try
|
||||
{
|
||||
Boolean allowWrite = (Boolean)sysAdminCache.get(KEY_SYSADMIN_ALLOW_WRITE);
|
||||
return (allowWrite == null ? false : ! allowWrite);
|
||||
}
|
||||
catch (IllegalStateException e)
|
||||
{
|
||||
// The cache is not working
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user