[ALF-712] HibernateOptimisticLockingFailureException appears on concurrent access to versioned contents by different users Created: 28-Jan-10  Updated: 25-Jun-10  Resolved: 24-Mar-10

Status: Closed
Project: Alfresco
Component/s: Repository
Affects Version/s: 3.2 R Enterprise
Fix Version/s: 3.3 Community, 3.3 Enterprise

Type: Bug Priority: Critical
Reporter: Alfresco QA Team (Inactive) Assignee: Closed Bugs (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Alfresco Enterprise 3.2.0 (r 354)
on MS Windows 2003 Enterprise SP2 32bit, Tomcat 6.0.18 (JDK 1.6.0_11-b03), MySQL 5.1.41.


Attachments: Text File HibernateOptimisticLockingFailureException-3.2.0.354.log     Text File SQLException-3.2.0.354.log     Text File alfresco-3.2.0.354.log     Zip Archive alfresco-qa-team_results_2010-03-31.zip .zip     Zip Archive alfresco-qa-team_results_2010-05-03.zip     PNG File multiply-editing-online-different-contents-3.2.0.354.png    
Issue Links:
Related
Date of First Response:

 Description   

Concurrency issue: attempt to perform "Edit Content Online" action for different contents by different users (each for its own) leads to error appearance (HibernateOptimisticLockingFailureException) for part of them:

12:29:26,888 ERROR [org.alfresco.web.ui.common.Utils] Unable to check in Content Node due to system error:Object of class [org.alfresco.repo.domain.hibernate.VersionCountImpl] with identifier [1]: 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.VersionCountImpl#1
org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [org.alfresco.repo.domain.hibernate.VersionCountImpl] with identifier [1]: 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.VersionCountImpl#1
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): org.alfresco.repo.domain.hibernate.VersionCountImpl#1

(please see screen and full logs in attach).

Issue may appear since 20 concurrent users.

Scenario for each user is the following:
1. Create Content (each create separate test content in own userhome);
2. Make Content Versionable;
3. Edit Content:
3.1. search content;
3.2. edit content online;
3.3. save edited content;
3.4. search content;
3.5. check-in content;
3.6. add version notes;
4. Delete Content.

Think time is emulated for each step of Edit Content action (1-6 sec).

Issue appears on the "3.6. add version notes" step (please see attach).

It seems as if getNodeService() cannot get corresponding nodeRef because lucene-indexer works too slow: "[org.alfresco.web.bean.coci.CheckinCheckoutDialog] WARNING: editInlineOK called without a current Document!" appears in alfresco.log (see attach).



 Comments   
Comment by Alfresco QA Team (Inactive) [ 28-Jan-10 ]

I've seen the following issue submitted previously but for a bit another scenario:
https://issues.alfresco.com/jira/browse/ALFCOM-1683
http://forums.alfresco.com/en/viewtopic.php?f=4&t=12645
(this refers to concurrent access to the same versioned content by several users and was tested via JCR API).

May be this will help.

Comment by Dave Ward [X] (Inactive) [ 16-Mar-10 ]

It looks like

org.alfresco.web.ui.common.Utils.addErrorMessage(String, Throwable)

is logging exceptions as errors that would normally be retried silently. Shouldn't it check if the exception is retryable using org.alfresco.repo.transaction.RetryingTransactionHelper.extractRetryCause(Throwable) ?

Comment by Kevin Roast [X] (Inactive) [ 19-Mar-10 ]

The code calling the coci service is already wrapped in a retrying txn handler. See CheckinCheckoutDialog.checkinFileOK() - the Utils.addErrorMessage() would only get called if the retrying had consistently failed.

Comment by Steve Rigby [X] (Inactive) [ 29-Mar-10 ]

For retest in b2742

Comment by Alfresco QA Team (Inactive) [ 31-Mar-10 ]

Successfully validated against Alfresco Community 3.3.0 build 2747 (MS Windows 2003 Enterprise SP2 32bit, Tomcat 6.0.18 (JDK 1.6.0_11-b03), MySQL 5.1.41.) witn 1-50 concurrent users.

Postponed to 3.3 Enterprise relaese for further validation (in accordance with Fix Versions).

Comment by Steve Rigby [X] (Inactive) [ 04-Apr-10 ]

For retest in 3.3C b2758

Comment by Alfresco QA Team (Inactive) [ 03-May-10 ]

Successfully tested against Alfresco Enterprise 3.3.0 dev r19653(MS Windows 2003 Enterprise SP2 32bit, Tomcat 6.0.18 (JDK 1.6.0_18-b07), MySQL 5.1.41.) witn 1-50 concurrent users @ 1 and 2 loops.
Validation logs attached.

Comment by Alfresco QA Team (Inactive) [ 17-Jun-10 ]

All retests completed

Comment by Alfresco QA Team (Inactive) [ 25-Jun-10 ]

Successfully tested against Alfresco Enterprise 3.3.1.96(MS Windows 2008 Server Enterprise SP1 64bit, Tomcat 6.0.18 (JDK 1.6.0_20-b02), MySQL 5.1.39-community) witn 1-50 concurrent users @ 1/2/5/10 loops.

Generated at Mon Mar 08 16:32:27 GMT 2021 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.