cancel
Showing results for 
Search instead for 
Did you mean: 

Change data per service - Share does not update it

alfresc0t3ster
Champ in-the-making
Champ in-the-making
Hello!

I have a weird problem or I have found a bug in Alfresco 5.0c.

I am currently testing some services in the backend and wrote my own service to overlay the others.
Therein I am using the FileFolderService. Example code of a function:

<blockcode>

TransactionService transactionService = (TransactionService) appContext.getBean("transactionService");
       UserTransaction tx = null;
      
      try {
         FileInfo target_info = fileFolderService.getFileInfo(fileFolder);

         try {
            tx = transactionService.getUserTransaction();
            tx.begin();

            fileFolderService.rename(target_info.getNodeRef(), newName);

            tx.commit();
         } catch (Exception e) {
            System.err.println(e.getMessage());
            if (tx != null) {
               try {
                  tx.rollback();
               } catch (IllegalStateException e1) {
                  e1.printStackTrace();
               } catch (SecurityException e2) {
                  e2.printStackTrace();
               } catch (SystemException e3) {
                  e3.printStackTrace();
               }
            }
            return false;
         }
      } catch (Exception ex) {
         System.err.println("### ERROR - renameFile - Transaction");
         System.err.println(ex.getMessage());
         return false;
      }

</blockcode>

It renames a file or a folder. It works, but Share does not update the name in the user interface immediatly (only after 1-5minutes).
If I change a name of a folder, Share interface orders the folder in the correct alphabetically order (uses the changed name), but displays the old folder name.

This happens also with others functions like write content into a file. Share displays the old content (even if I download the file), but if I read out the content in Java, I am getting the changed content of the file.

Refreshing/Clearing cache, dropping/renew session does not change anything. Even with a other browser.

Someone got an answer for that?
1 REPLY 1

alfresc0t3ster
Champ in-the-making
Champ in-the-making
I just tested it now with a deleteFunction():

Document: /My_uploads/test.txt

If i delete this file per Java, it disappears in the share user interface browser of /My_uploads, but the workspace URL to the file still works in share.

After 5 minutes (Share: 'Oh  there is a change, lets update it, sry I was sleeping') , the workspace URL does not work anymore. Weird, weird, weird…