public function save(PropelPDO $con = null)
 {
     KalturaLog::log("BatchJob [{$this->getJobType()}][{$this->getJobSubType()}]: save()");
     $is_new = $this->isNew();
     if ($this->isNew()) {
         // set the dc ONLY if it wasnt initialized
         // this is required in the special case of file_sync import jobs which are created on one dc but run from the other
         // all other jobs run from the same datacenter they were created on.
         // setting the dc later results in a race condition were the job is picked up by the current datacenter before the dc value is changed
         if (is_null($this->dc) || !$this->isColumnModified(BatchJobPeer::DC)) {
             // by default set the dc to the current data center. However whenever a batch job is operating on an entry, we rather run it
             // in the DC where the file sync of the entry exists. Since the batch job doesnt refer to a flavor (we only have an entry id member)
             // we check the file sync of the source flavor asset (if one exists)
             $dc = kDataCenterMgr::getCurrentDcId();
             kalturaLog::debug("setting the job's DC to [{$dc}]");
             $this->setDc($dc);
         }
         // if the status not set upon creation
         if (is_null($this->status) || !$this->isColumnModified(BatchJobPeer::STATUS)) {
             //echo "sets the status to " . self::BATCHJOB_STATUS_PENDING . "\n";
             $this->setStatus(self::BATCHJOB_STATUS_PENDING);
         }
     }
     $result = array_intersect(self::$LOCK_VERSION_AFFECTED_BY_COLUMNS_NAMES, $this->getModifiedColumns());
     if (count($result) > 0) {
         $this->setLockVersion($this->getLockVersion() + 1);
     }
     $res = parent::save($con);
     if ($is_new && !$this->root_job_id && $this->id || $this->useNewRoot) {
         // set the root to point to itself
         $this->setRootJobId($this->id);
         $res = parent::save($con);
     }
     /*		
      * 	remove - no need to use file indicators any more
     		// when new object or status is pending - add the indicator for the batch job to start running
     		if ( $is_new || ( $this->getStatus() == self::BATCHJOB_STATUS_PENDING ) )
     		{
     			self::addIndicator( $this->getId() , $this->getJobType() );
     			KalturaLog::log ( "BatchJob: Added indicator for BatchJob [" . $this->getId() . "] of type [{$this->getJobType() }]" );
     			//debugUtils::st();			
     		}
     		else
     		{
     			KalturaLog::log ( "BatchJob: Didn't add an indicator for BatchJob [" . $this->getId() . "]" );
     		}
     */
     return $res;
 }
 /**
  * Update media entry. Only the properties that were set will be updated.
  * 
  * @action update
  * @param string $entryId Media entry id to update
  * @param KalturaMediaEntry $mediaEntry Media entry metadata to update
  * @return KalturaMediaEntry The updated media entry
  * @throws KalturaErrors::ENTRY_ID_NOT_FOUND
  * @validateUser entry entryId edit
  */
 function updateAction($entryId, KalturaMediaEntry $mediaEntry)
 {
     $dbEntry = entryPeer::retrieveByPK($entryId);
     if (!$dbEntry) {
         $dcIndex = kDataCenterMgr::getDCByObjectId($entryId, true);
         if ($dcIndex != kDataCenterMgr::getCurrentDcId()) {
             kalturaLog::debug("EntryID [{$entryId}] wasn't found on current DC. dumping the request to DC id [{$dcIndex}]");
             kFile::dumpApiRequest(kDataCenterMgr::getRemoteDcExternalUrlByDcId($dcIndex));
         }
     }
     if (!$dbEntry || $dbEntry->getType() != KalturaEntryType::MEDIA_CLIP) {
         throw new KalturaAPIException(KalturaErrors::ENTRY_ID_NOT_FOUND, $entryId);
     }
     $mediaEntry = $this->updateEntry($entryId, $mediaEntry, KalturaEntryType::MEDIA_CLIP);
     return $mediaEntry;
 }