protected ItemStateChangesLog optimizeAndGetChangesLog()
{
// get all persisted property states, to avoid iterating by other states
LinkedList<RemovableItemSate> persistedCheckedStates = new LinkedList<RemovableItemSate>();
ChangesLogIterator changesLogIterator = ((TransactionChangesLog)log).getLogIterator();
while (changesLogIterator.hasNextLog())
{
PlainChangesLog changesLog = changesLogIterator.nextLog();
for (ItemState itemState : changesLog.getAllStates())
{
if (itemState.isPersisted() && !itemState.isNode())
{