Version Differences for Error storing object in database: Version X is not up to date Y for Z

(Cause)
(There is no 'Y' in the error)
Line 1:
- This error can stem from a multitude of things, but it usually indicates that an attempt was made to write something to the database, but the item was out of sync. This mostly occurs when trying to run stuff in parallel. Examples of the error may include:   + #REDIRECT [[Error storing object in database: Version X is not up to date for Z]]  
       
- <pre>com.urbancode.anthill3.domain.persistent.PersistenceException:      
- Error storing object in database: Version X is not up to date for build life job trace Z</pre>      
- <pre>com.urbancode.anthill3.domain.persistent.ConcurrentModificationException:      
- Version X is not up to date for build life job trace Z</pre>      
       
- '''After-Effect Error:'''      
- <pre>com.urbancode.anthill3.domain.persistent.PersistenceException:      
- com.urbancode.anthill3.domain.lock.LockableResource: Persistent IDs cannot be changed once set</pre>      
       
- = Cause =      
       
- There are internal database tables that keep track of every record being wrote to it. Every time a change is made to a property/lock/etc., that version is incremented. When working in parallel, it is possible that both objects will try to update the version number to the next highest amount, but one object may have already succeeded in the update. Therefore, the next object will fail since the version number is already at the version it was going to assign. Some of this can be found within Anthill's '''HI_LO_SEQ''' table:      
       
- <pre>SEQ_NAME HI_VAL      
- ------------------------------ ------      
- ...      
- .      
- .      
- BUILD_LIFE 372      
- BUILD_LIFE_DEPENDENCY_PLAN 372      
- .      
- .      
- .      
- LOCK_HOLDER 1630      
- .      
- .      
- .      
- PROJECT 160      
- PROJECT_ENV_PROP 1      
- PROPERTY_VALUE_GROUP 16      
- .      
- .      
- .      
- WORKFLOW_CASE 720      
- .      
- .      
- ...      
- </pre>      
       
- If the updated version is less than what the HI_VAL is already set to in the database, it is discarded and an exception is thrown.