Actions
bug #6546
openAdding identifier does not always work
Status:
In Progress
Priority:
Highest
Assignee:
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:
0%
Estimated time:
Severity:
normal
Found in Version:
Description
Probably this is related to the size() problem in PersistentLists (see #5211): If a PersistentList is detached (not bound to a session) it adds new objects NOT to the underlying list but to an operationQueue. The operation queue is handled during reattache.
(from PersistentList line 312ff)
@Override
@SuppressWarnings("unchecked")
public void add(int index, Object value) {
if ( index < 0 ) {
throw new ArrayIndexOutOfBoundsException( "negative index" );
}
if ( !isInitialized() || isConnectedToSession() ) {
// NOTE : we don't care about the inverse part here because
// even if the collection is inverse, this side is driving the
// writing of the indexes. And because this is a positioned-add
// we need to load the underlying elements to know how that
// affects overall re-ordering
write();
list.add( index, value );
}
else {
queueOperation( new Add( index, value ) );
}
}
The objects in the operationQueue are NOT considered when calling PersistentList.size().
Therefore calls to size like in IdentifiableEntity.addIdentifier() create unexpected results.
@Override
public void addIdentifier(Identifier identifier){
addIdentifier(getIdentifiers().size(), identifier);
}
The problem only exists if add() is called with an index, like add(int, obj). The default add(obj) handles the list as expected:
@Override
public boolean add(Object object) {
if ( !isOperationQueueEnabled() ) {
write();
return list.add( object );
}
else {
queueOperation( new SimpleAdd( object ) );
return true;
}
}
Related issues
Updated by Andreas Müller about 7 years ago
- Related to bug #5211: Error when creating new taxon /problem with sortindex in taxon tree added
Updated by Andreas Müller about 7 years ago
- Description updated (diff)
- Status changed from New to In Progress
Updated by Andreas Müller over 6 years ago
- Target version changed from Release 4.7 to Release 4.11
Updated by Andreas Müller over 6 years ago
- Target version changed from Release 4.11 to Release 4.12
Updated by Andreas Müller over 6 years ago
- Target version changed from Release 4.12 to Release 4.13
Updated by Andreas Müller about 6 years ago
- Target version changed from Release 4.13 to Release 4.14
Updated by Andreas Müller about 6 years ago
- Target version changed from Release 4.14 to Release 5.0
Updated by Andreas Müller almost 6 years ago
- Target version changed from Release 5.0 to Release 5.1
Updated by Andreas Müller almost 6 years ago
- Target version changed from Release 5.1 to Release 5.2
Updated by Andreas Müller over 5 years ago
- Target version changed from Release 5.2 to Release 5.3
Updated by Andreas Müller over 5 years ago
- Target version changed from Release 5.3 to Release 5.4
Updated by Andreas Müller over 5 years ago
- Target version changed from Release 5.4 to Release 5.5
Updated by Andreas Müller about 5 years ago
- Target version changed from Release 5.5 to Release 5.6
Updated by Andreas Müller about 5 years ago
- Target version changed from Release 5.6 to Reviewed Next Major Release
Actions