cancel
Showing results for 
Search instead for 
Did you mean: 

Error changing metatdata of a document straight after upload

amarg
Champ in-the-making
Champ in-the-making
Hello Experts,

I would like to hear from people who have come accross the javascript error below and also understand how you resolved it (if anyone managed to):


Wrapped org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [org.alfresco.repo.domain.hibernate.NodeImpl] with identifier [18869]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.alfresco.repo.domain.hibernate.NodeImpl#18869]

My actions are:

1. I create a custom button in the document toolbar that calls a custom action for a single file upload which then calls a webscript when successful.
2. I try to change metadata and save the recently uploaded document within the webscript and this is where I encounter this error. I have confirmend that the error is not related to the changes I make to the document.

I suspect this has something to do with transaction management in Alfresco. Any information would be highly appreciated.

AmarG
2 REPLIES 2

palba
Champ in-the-making
Champ in-the-making
Not sure, buy have you tried to save the document before change the metadata, then change it, and then save it again? Some time ago I have a similar problem, and that was the key

amarg
Champ in-the-making
Champ in-the-making
I have tried that palba and this had not worked. Regardless of whether I change anything, I get an error when I call doc.save().

The interesting thing about this issue is that, although I do get an error message, all the changes happen as expected i.e. the metadata gets updated after the script.