2

This piece of code moves all current versions of files from one folder to another but leaves all older versions unmoved. (Context is java code of DFC accessing Documentum.)

 String strObjId = versionColl.getString("r_object_id");
        com.documentum.fc.common.IDfId curObjectID = new DfId(strObjId);
        IDfSysObject curObj = (IDfSysObject)sess.getObject(curObjectID);
        versionlabel = curObj.getAllRepeatingStrings("r_version_label", ",");
        System.out.println("Moving document with Name:" + objName + "  and version:" + versionlabel);
        if (runMode.equals("1")) {
         curObj.unlink(oldpath);
         curObj.link(newpath);
         curObj.setString("a_special_app", curObj.getString("r_modifier"));
         curObj.setTime("a_last_review_date", curObj.getTime("r_modify_date"));
         curObj.setString("a_category","MOVED");
         curObj.save();
         System.out.println("Successfully Moved document with Name:" + objName + " and version:" + versionlabel);
        }

The error we were getting while moving older versions was "document immutable". So we added this piece of code that temporarily disables the immutable flag, allows the file to be moved and then resets the immutable flag to true.

curObj.setBoolean("r_immutable_flag", false);

The problem then was that this code ran perfectly on our dev machine (windows) while it crashed on production(windows) (gave link error). Any ideas as to why this is acting as it is and other codes to solve this issue would be great. Thanks.

shsteimer
  • 28,436
  • 30
  • 79
  • 95
Regmi
  • 2,658
  • 4
  • 24
  • 32
  • Maybe you could include more details in the error you are facing in production. – David Pierre Sep 29 '09 at 11:25
  • 2
    If the code is the same, you got differences between dev configuration and prod configuration. Give us your exact error to help us understand what is wrong (write permit, unexisting target folder, ...) – enguerran Oct 02 '09 at 14:45

1 Answers1

1

Based on the little info given, it could be just about anything but my guess is that it's a permissions issue. Specifically, the user running this code does not have the proper permissions to move one(or more) of the documents you are trying to move OR the user running the code does not have enough permissions to link objects to the target folder.

shsteimer
  • 28,436
  • 30
  • 79
  • 95
  • I doubt this is a permission problem. In order to set the `r_immutable_flag` attribute you _must_ be superuser. System administrator is not enough, not even if you have DELETE permission for the object. Since he doesn't get a `[DM_API_E_UPDATE_BAD_ATTR]error: "The attribute 'r_immutable_flag' is not updateable."` error, i suspect he's using a superuser account already. – eivamu Mar 11 '14 at 08:51