final void cmdAdd ( final LinkOwner stream , long lockID , final PersistentTransaction transaction ) throws StreamIsFull , ProtocolException , TransactionException , SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cmdAdd" , new Object [ ] { "Item Link: " + this , "Stream Link: " + stream , formatLockId ( lockID ) , "Transaction: " + transaction } ) ; synchronized ( this ) { if ( ItemLinkState . STATE_NOT_STORED == _itemLinkState ) { ListStatistics stats = getParentStatistics ( ) ; stream . _assertCanAddChild ( transaction , stats ) ; // Defect 510343.1 stats . incrementAdding ( _inMemoryItemSize ) ; _lockID = lockID ; _transactionId = transaction . getPersistentTranId ( ) ; if ( NO_LOCK_ID == lockID ) { _itemLinkState = ItemLinkState . STATE_ADDING_UNLOCKED ; } else { _itemLinkState = ItemLinkState . STATE_ADDING_LOCKED ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Invalid Item state: " + _itemLinkState ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdAdd" ) ; throw new StateException ( _itemLinkState . toString ( ) ) ; } } final Task task = new AddTask ( this ) ; transaction . addWork ( task ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cmdAdd" ) ; }
Set the state to adding