{
throw new IllegalStateException( "Property add on node[" +
nodeId + "] illegal since it has been deleted." );
}
PropertyRecord propertyRecord = new PropertyRecord( propertyId );
propertyRecord.setInUse( true );
propertyRecord.setCreated();
propertyRecord.setNodeId( nodeId );
// encoding has to be set here before anything is change
// (exception is thrown in encodeValue now and tx not marked
// rollback only
getPropertyStore().encodeValue( propertyRecord, value );
if ( nodeRecord.getNextProp() != Record.NO_NEXT_PROPERTY.intValue() )
{
PropertyRecord prevProp = getPropertyRecord(
nodeRecord.getNextProp() );
if ( prevProp == null )
{
prevProp = getPropertyStore().getLightRecord(
nodeRecord.getNextProp() );
addPropertyRecord( prevProp );
}
assert prevProp.getPrevProp() ==
Record.NO_PREVIOUS_PROPERTY.intValue();
prevProp.setPrevProp( propertyId );
propertyRecord.setNextProp( prevProp.getId() );
}
int keyIndexId = index.getKeyId();
propertyRecord.setKeyIndexId( keyIndexId );
nodeRecord.setNextProp( propertyId );
addPropertyRecord( propertyRecord );