You are viewing limited content. For full access, please sign in.

Question

Question

EntryNameOption.Overwrite throwing 9002 error

asked on December 19, 2017

I am trying to use the DocumentInfo.Create method with the EntryNameOption set to EntryNameOption.Overwrite, but when there is a name conflict I get a 9002 (Object already exists) error.

 

Laserfiche.RepositoryAccess.DuplicateObjectException: Object already exists. [9002]
   at Laserfiche.RepositoryAccess.EntryLock.LockInternal(HttpUrl url, LockType type, Dictionary`2 additionalHeaders, String etag)
   at Laserfiche.RepositoryAccess.EntryLock..ctor(EntryInfo info, EntryNameOption options)
   at Laserfiche.RepositoryAccess.Entry.MakeDocFolderWithLock(EntryInfo info, EntryNameOption options)
   at Laserfiche.RepositoryAccess.DocumentInfo.Create(FolderInfo parent, String name, EntryNameOption options)

 

1 0

Replies

replied on May 9, 2019

Running into the same problem. I want to overwrite a document that was previously created. Using the code below with the overwrite option returns a 9002. All of the other options work without issue.

doc.Create(docname, "DEFAULT", EntryNameOption.Overwrite);

1 0
replied on December 19, 2017

This error is returned if the existing entry is a folder. The overwrite option will only work to overwrite a document. Try deleting the existing folder first.

0 0
replied on December 19, 2017

The existing entry is a document though. The part of my code that creates folders uses AutoRename, and isn't being hit anyway. The folder already exists, so I'm using the existing folder and attempting to create a document inside of it. I had no issues with this the first run through, with many documents re-using the same folder as their destination. But now that it's trying to overwrite duplicate documents I'm getting this.

 

I can see the "Entry.MakeDocFolderWithLock" part of the stack trace implying that it's trying to create a folder, but why would the DocumentInfo.Create method be creating a folder?

0 0
replied on December 19, 2017

"MakeDocFolderWithLock" is shorthand for "make document or folder with lock". Can you add code to check if an entry already exists at the path, and delete it if so? I think that is probably better than spending a lot of time trying to figure out why it is incorrectly failing with 9002.

0 0
replied on November 21, 2018

Sorry for bumping an old thread but I am also facing the same problem. I am pretty sure that the entry name is a document and not a folder. All other EntryName options are working but I can't figure out why EntryNameOption.Overwrite is throwing a 9002 error.

Checking if an entry already exists at the path is taking a long time since my repository has 1000s of files. I am creating an app for doing mass-update of files and I cannot check every file if it already exists since it will be a huge performance hit on my app.

Any help is appreciated. Thanks.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.