public boolean commit(){
		if(writes.size()==0)
			return true;
		Write primary=writes.get(0);
		if(!prewrite(primary,primary))
			return false;
		for(int i=1;i<writes.size();i++){
			if(!prewrite(writes.get(i),primary))
				return false;
		}
		commit_ts=OracleTimestampEmu.getCurTimestamp();
		Write p=primary;
		BigTable table=TableManager.getTable(p.table);
		NewRowTransaction tr=table.startRowTransaction(p.row);
		String primLock=tr.read(new Column("lock"), start_ts,start_ts);
		if(primLock==null)
			return false;
		tr.write(new Column("write"), commit_ts, start_ts+"");
		tr.erase(new Column("lock"),commit_ts);
		if(!tr.commit())
			return false;
		
		for(int i=1;i<writes.size();i++){
			Write w=writes.get(i);
			BigTable curtable=TableManager.getTable(w.table);
			curtable.write(w.row, new Column("write"), commit_ts, start_ts+"");
			curtable.write(w.row, new Column("lock"), commit_ts, null);
		}
		return true;
	}