Forums de discussion

Document Library: UpdateFileEntry gives error after version 10!

thumbnail
lou cat, modifié il y a 10 années.

Document Library: UpdateFileEntry gives error after version 10!

Regular Member Publications: 196 Date d'inscription: 26/01/12 Publications récentes
Hello all,

I'm not sure if this error is related to my code or a bug, I didn't find anything on the forum or in JIRA.

I've created a portlet that export the list of users of the organization chosen, but it gives me error after version 9.0 (if I set majorVersion=true) or after 1.09 (otherwise).

This is the method I am calling:

DLFileEntryLocalServiceUtil.updateFileEntry(currentUser.getUserId(), currentGroup.getGroupId(), LRtoolFolderId, dlFileEntry.getName(),"users.csv", dlFileEntry.getTitle(), dlFileEntry.getDescription(), "", false, dlFileEntry.getExtraSettings(), file, serviceContext);


after the 10th export I got this exception:

Batch entry 0 insert into DLFileVersion

[...]

and related to this constraint:

CREATE UNIQUE INDEX ix_2f8fed9c
ON dlfileversion
USING btree
(groupid , folderid , name , version );


but as the only thing that should change in the file is the version itself, and this is done automatically by liferay, and as this works until version 10... I believe it may be a bug.

Has anyone experienced this?
Do you have any idea to figure out if it's an error in my code or If I can maybe fix this bug with a hook?

My liferay version is 6.0.6, I'm using the default document library repository, under Linux/Tomcat.

Thanks for any feedback!
thumbnail
lou cat, modifié il y a 10 années.

RE: Document Library: UpdateFileEntry gives error after version 10!

Regular Member Publications: 196 Date d'inscription: 26/01/12 Publications récentes
Thanks Kan!

I don't want to build the source code though, I would have preferred a less low-level solution... but at least I know what's happening emoticon

So I'm simply deleting the previous entry and creating a new file, every time with version 1...