public void commit() throws IOException {
		//write all uncommited free records		
		Iterator<Long> rowidIter = freeBlocksInTransactionRowid.iterator();
		Iterator<Integer> sizeIter = freeBlocksInTransactionSize.iterator();
		PageCursor curs = new PageCursor(_pageman, Magic.FREEPHYSIDS_PAGE);
		//iterate over filled pages
		while (curs.next() != 0) {
			long freePage = curs.getCurrent();
			BlockIo curBlock = _file.get(freePage);
			FreePhysicalRowIdPage fp = FreePhysicalRowIdPage.getFreePhysicalRowIdPageView(curBlock, blockSize);
			int slot = fp.getFirstFree();
			//iterate over free slots in page and fill them
			while(slot!=-1 && rowidIter.hasNext()){
				long rowid = rowidIter.next();
				int size = sizeIter.next();		
				short freePhysRowId = fp.alloc(slot);
				fp.setLocationBlock(freePhysRowId, Location.getBlock(rowid));
				fp.setLocationOffset(freePhysRowId, Location.getOffset(rowid));
				fp.FreePhysicalRowId_setSize(freePhysRowId, size);
				slot = fp.getFirstFree();
			}
			_file.release(freePage, true);
			if(!rowidIter.hasNext())
				break;
		}
		
		//now we propably filled all already allocated pages,
		//time to start allocationg new pages
		while(rowidIter.hasNext()){
			//allocate new page
			long freePage = _pageman.allocate(Magic.FREEPHYSIDS_PAGE);
			BlockIo curBlock = _file.get(freePage);
			FreePhysicalRowIdPage fp = FreePhysicalRowIdPage.getFreePhysicalRowIdPageView(curBlock, blockSize);
			int slot = fp.getFirstFree();
			//iterate over free slots in page and fill them
			while(slot!=-1 && rowidIter.hasNext()){
				long rowid = rowidIter.next();
				int size = sizeIter.next();		
				short freePhysRowId = fp.alloc(slot);
				fp.setLocationBlock(freePhysRowId, Location.getBlock(rowid));
				fp.setLocationOffset(freePhysRowId, Location.getOffset(rowid));
				fp.FreePhysicalRowId_setSize(freePhysRowId, size);
				slot = fp.getFirstFree();
			}
			_file.release(freePage, true);
			if(!rowidIter.hasNext())
				break;
		}
		
		if(rowidIter.hasNext())
			throw new InternalError();

		freeBlocksInTransactionRowid.clear();
		freeBlocksInTransactionSize.clear();
		
	}