10-05-2009 11:05 PM
TransactionService myTransactionService = this.services.getTransactionService();
TransactionServiceImpl serviceAction = (TransactionServiceImpl)myTransactionService;
boolean status = myTransactionService.isReadOnly();
if(aToggle && !status)
{
//toggle read only
serviceAction.setAllowWrite(false);
aMessage = "Alfresco in read-only status";
System.out.println("Toggling read-only");
}
<status>
500
<name>Internal Error</name>
<description>An error inside the HTTP server which prevented it from fulfilling the request.</description>
</status>
<message>Wrapped Exception (with status template): Failed to execute script '/com/moxy/Metadata/metadata.get.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)': Read-Write transaction started within read-only transaction</message>
<exception>org.alfresco.web.scripts.WebScriptException - Wrapped Exception (with status template): Failed to execute script '/com/moxy/Metadata/metadata.get.js (in repository store workspace://SpacesStore/Company Home/Data Dictionary/Web Scripts Extensions)': Read-Write transaction started within read-only transaction</exception>
<callstack>org.alfresco.error.AlfrescoRuntimeException: Read-Write transaction started within read-only transaction org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:292) org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:227) org.alfresco.repo.web.scripts.RepoStore$RepoScriptContent$1.doWork(RepoStore.java:906) org.alfresco.repo.web.scripts.RepoStore$RepoScriptContent$1.doWork(RepoStore.java:904) org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:437) org.alfresco.repo.web.scripts.RepoStore$RepoScriptContent.getInputStream(RepoStore.java:902) org.alfresco.repo.web.scripts.RepositoryScriptProcessor$RepositoryScriptLocation.getInputStream(RepositoryScriptProcessor.java:163) org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:119) org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:263) org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:108) org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:800) org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90) org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:319) org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:320) org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:227) org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:368) org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:390) org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:273) org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:261) org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139) org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
<authentication>guest</authentication>
<transaction>none</transaction>
10-06-2009 04:35 AM
10-14-2009 08:55 AM
10-14-2009 07:24 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.