Document checkin fails

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Document checkin fails

Hello All

We are getting this exception while checking in multiple versions of the document. It seems like the update is not complete yet and checkin appears too early. Is there a way to confirm that document versions has been updated before we check in?

CmisStorageException: Expected 29184 bytes but retrieved 0 bytes!

org.apache.chemistry.opencmis.client.bindings.spi.browser.AbstractBrowserBindingService.post(AbstractBrowserBindingService.java:362)

        at org.apache.chemistry.opencmis.client.bindings.spi.browser.VersioningServiceImpl.checkIn(VersioningServiceImpl.java:123)

        at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.checkIn()

Many thanks

Krzysztof

4 Replies
Highlighted
Professional

Re: Document checkin fails

If you post the Java code that is performing the checkout and the check-in someone might be able to help you. Otherwise, we can only guess.

Highlighted
Member II

Re: Document checkin fails

Sure, sorry about that. I are using OpenCMIS api to call alfresco core:

ObjectId pwcId = ((Document) target).checkOut();
Document pwcDocument = (Document) session.getObject(pwcId);
ContentStream contentStream = createContentStream(name, contentlength, mimeType, content);
ObjectId newVersionId = pwcDocument.checkIn(updateMajor, null, contentStream, "new version");

The problem is we update the document in batch, creating new versions. It seems like previous update is not complete when we attempt to check out for new version.

It would be nice to instruct CMIS to perform checkout when the previous check-in is complete.

Highlighted
Member II

Re: Document checkin fails

Would you say that DocumentProperties.isVersionSeriesCheckedOut() is a good assumption about document being ready for checkout? Or if clients should sleep and try again in 2s?

Highlighted
Active Member II

Re: Document checkin fails

Dear Longinus,

Have you found to solution for this issue? I'm  facing the same issue. So I must Sleep 2s, a try again later. But I don't like this.