private void deleteValues ( String cid , PropertyData pdata , boolean update , ChangedSizeHandler sizeHandler ) throws IOException , SQLException , RepositoryException , InvalidItemStateException { Set < String > storages = new HashSet < String > ( ) ; final ResultSet valueRecords = findValueStorageDescAndSize ( cid ) ; try { if ( valueRecords . next ( ) ) { do { final String storageId = valueRecords . getString ( COLUMN_VSTORAGE_DESC ) ; if ( ! valueRecords . wasNull ( ) ) { storages . add ( storageId ) ; } else { sizeHandler . accumulatePrevSize ( valueRecords . getLong ( 1 ) ) ; } } while ( valueRecords . next ( ) ) ; } // delete all values in value storage for ( String storageId : storages ) { final ValueIOChannel channel = this . containerConfig . valueStorageProvider . getChannel ( storageId ) ; try { sizeHandler . accumulatePrevSize ( channel . getValueSize ( pdata . getIdentifier ( ) ) ) ; channel . delete ( pdata . getIdentifier ( ) ) ; valueChanges . add ( channel ) ; } finally { channel . close ( ) ; } } // delete all Values in database deleteValueData ( cid ) ; } finally { JDBCUtils . freeResources ( valueRecords , null , null ) ; } }
Delete Property Values .