01-10-2008 06:45 AM
try {
UserTransaction transaction = transactionService.getNonPropagatingUserTransaction();
transaction.begin();
authenticationService.authenticate(LOGIN, PASSWORD.toCharArray());
NodeRef nodeRef = new NodeRef("workspace://SpacesStore/rubbish"); // invalid input
int status = alfrescoContext.getTransaction().getStatus(); // 0
nodeService.getProperty(nodeRef, ContentModel.PROP_CATEGORIES);
}
catch (Exception e)
{
int status = alfrescoContext.getTransaction().getStatus(); // (*)
}
transaction.commit();
01-21-2008 12:59 PM
01-21-2008 02:12 PM
02-04-2008 04:28 AM
grep AlfrescoRuntimeException `find HEAD -name '*xml'`
An error occurred in one of the dashlets.
* Failed to get to do tasks: javax.transaction.RollbackException: The transaction has already been marked for rollback
* Failed to get pooled tasks: javax.transaction.RollbackException: The transaction has already been marked for rollback
* Failed to get all active tasks: javax.transaction.RollbackException: The transaction has already been marked for rollback
02-04-2008 09:29 AM
02-04-2008 12:02 PM
package org.alfresco.web.action.evaluator;
import javax.faces.context.FacesContext;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.action.ActionEvaluator;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.security.AuthenticationService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.web.bean.ml.MultilingualUtils;
import javax.faces.context.FacesContext;
import javax.transaction.UserTransaction;
import org.alfresco.web.app.servlet.FacesHelper;
public class CutNodeEvaluator extends BaseActionEvaluator
{
public boolean evaluate(Node node)
{
// BEGIN for debugging only
FacesContext fc = FacesContext.getCurrentInstance();
NodeService nodeService = (NodeService) FacesHelper.getManagedBean(fc, "NodeService");
TransactionService transactionService = (TransactionService) FacesHelper.getManagedBean(fc, "TransactionService");
AuthenticationService authenticationService = (AuthenticationService) FacesHelper.getManagedBean(fc, "AuthenticationService");
try
{
UserTransaction transaction = null;
try
{
//transaction = transactionService.getNonPropagatingUserTransaction(); // (**)
//transaction.begin(); // (**)
//authenticationService.authenticate("admin", "J8uqw82_".toCharArray()); // (**)
NodeRef nodeRef = new NodeRef("workspace://SpacesStore/rubbish"); // invalid input
//int status = transaction.getStatus(); // 0 // (**)
//System.err.println(status); // (**)
nodeService.getProperty(nodeRef, ContentModel.PROP_CATEGORIES);
}
catch (Exception e)
{
// int status = transaction.getStatus(); // (*) // (**)
// System.err.println(status); // (**)
}
// transaction.commit(); // (**)
}
catch (Exception e)
{
}
// END for debugging only
// just some dummy return value
return false;
}
}
02-05-2008 08:17 AM
05-21-2008 05:49 AM
06-27-2008 09:16 AM
10-08-2008 08:51 AM
Hi,
I need some advice from a Spring transaction guru, it seems: I don't get the following to work…
try {
UserTransaction transaction = transactionService.getNonPropagatingUserTransaction();
transaction.begin();
authenticationService.authenticate(LOGIN, PASSWORD.toCharArray());
NodeRef nodeRef = new NodeRef("workspace://SpacesStore/rubbish"); // invalid input
int status = alfrescoContext.getTransaction().getStatus(); // 0
nodeService.getProperty(nodeRef, ContentModel.PROP_CATEGORIES);
}
catch (Exception e)
{
int status = alfrescoContext.getTransaction().getStatus(); // (*)
}
transaction.commit();
Regards,
Kaspar
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.