AnsweredAssumed Answered

Transaction didn't commit

Question asked by vipin on Jul 9, 2007
Latest reply on Jul 3, 2008 by razvanchican
Hi

I am also having an issue.. :roll:
i am trying to add a new space in the home space.
but i am getting this error…

can anyone help ?

the method ,
TransactionUtil.executeInUserTransaction(transactionService,
            exampleWork);
is throwing the exceptions……

my code is……….
Code:

TransactionWork<Object> exampleWork = new TransactionWork<Object>() {

         public Object doWork() throws Exception {
                                createSpace(homeSpace);
                               return null;
         }
};

public boolean createSpace(NodeRef parentSpaceRef) throws SystemException {
      ServiceRegistry serviceRegistry = service.getServiceRegistry();
      boolean isSpaceCreated = true;
      NodeService nodeService = serviceRegistry.getNodeService();

      ChildAssociationRef assocRef;
      assocRef = nodeService.createNode(
               parentSpaceRef, ContentModel.ASSOC_CHILDREN,
               QName.createQName(
                     "http://www.alfresco.org/model/content/1.0", QName
                           .createValidLocalName("First Folder")),
               ContentModel.TYPE_FOLDER);

      if (assocRef == null) {
         return false;
      }
            
      return isSpaceCreated;
   }


Error:

Exception in thread "main" org.alfresco.error.AlfrescoRuntimeException: Unexpected rollback of exception:
Transaction didn't commit: Integrity failure
   at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:192)
   at org.alfresco.repo.transaction.TransactionUtil.executeInUserTransaction(TransactionUtil.java:82)
   at org.alfresco.example.vip.PortFolioUser.showHomeSpace(PortFolioUser.java:112)
   at org.alfresco.example.vip.Main.main(Main.java:18)
Caused by: javax.transaction.RollbackException: Transaction didn't commit: Integrity failure
   at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:412)
   at org.alfresco.repo.transaction.TransactionUtil.executeInTransaction(TransactionUtil.java:186)
   … 3 more
Caused by: org.alfresco.repo.node.integrity.IntegrityException: Integrity failure
   at org.alfresco.repo.node.integrity.IntegrityChecker.checkIntegrity(IntegrityChecker.java:619)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.flush(AlfrescoTransactionSupport.java:524)
   at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:595)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:657)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:482)
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:469)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:266)
   at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:405)
   … 4 more
:shock:


can anyone help ?


Thanks,


vipin

Outcomes