cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCMIS cancelCheckout still createing an new version

bbwang
Champ in-the-making
Champ in-the-making
We had this strange error when trying to cancelCheckout of a document, it still created a new version.  we are using Alfresco Enterprise 4.1.1, Chemistry OpenCMIS 0.8  We saw in the log the cancelCheckout, but still a new version is created.  any idea?

Here is my code snapshot

Document pwc = null ;
try {
//check it out
pwc = (Document) session.getObject(origDoc.checkOut());
//create the content stream
ContentStream contentStream  = session.getObjectFactory().createContentStream(origDoc.getContentStream().getFileName(), newVersion.length,
        origDoc.getContentStream().getMimeType(), new ByteArrayInputStream(newVersion));
// Check in the pwc
if(pwc!=null){
      OjectId newId= pwc.checkIn(false, propertiesMap, contentStream, "minor version");
      if(newId!=null){
   return newId.getId() ;
      }
}
} catch (Exception e) {
      try{
         if(pwc!=null)
      pwc.cancelCheckOut();
         LogUtility.logError(info, "checkout is cancelled", e) ;
       }
      catch(Throwable t){LogUtility.logError(info, "Failed to cancel checkout", e); }
          throw e ;
}
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
Can you confirm that the pwc.checkIn call is definitely not getting called?

Jeff