public function batchUpdate(Array $dataSet, $withAll=false, $maxLength=4*1024*1024, $runValidation=true)
    {
        $count = 0;
        $sqlBatch = '';
        
        foreach ($dataSet as $key => &$each) {

            // Data format
            list($attributes, $condition) = $each;

            // Check attributes
            if (!is_array($attributes) || !$attributes)
                continue; 

            // Validation
            if ($runValidation && false===$attributes=$this->validate($attributes, true))
                continue; 

            // WithAll helper
            if ($withAll===true) {
                $this->withAll();
            }
                
            // Model Condition
            $query = $this->_findByCondition($condition);

            $attributes = $this->_attrEventBeforeUpdate($attributes);

            // Pack query then move it to write DB from read DB
            $sql = $this->_dbr->set($attributes)->get_compiled_update();
            $this->_dbr->reset_query();

            // Last batch check: First single query & Max length
            // The first single query needs to be sent ahead to prevent the limitation that PDO transaction could not 
            // use multiple SQL line in one query, but allows if the multi-line query is behind a single query. 
            if (($count==0 && $sqlBatch) || strlen($sqlBatch)>=$maxLength) {
                // Each batch of query
                $result = $this->_db->query($sqlBatch);
                $sqlBatch = "";
                $count = ($result) ? $count + 1 : $count;
            }
            
            // Keep Combining query
            $sqlBatch .= "{$sql};\n";
        }

        // Last batch of query
        $result = $this->_db->query($sqlBatch);

        return ($result) ? $count + 1 : $count;
    }