Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7916)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7917)
@@ -46,4 +46,7 @@
      - implemented functions to get todolist via shell
      - improved logging
+     - replaced setstatus, implemented new function not calling root
+       but directly using shell and mysql to speed up the setting of 
+       the status
 
    * datacenter/scripts/jobmanager: 
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7916)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7917)
@@ -121,5 +121,5 @@
       continue
    else
-      exit
+      finish
    fi
 }
@@ -199,9 +199,7 @@
 }
 
-# function calling the macro to set the status, after a process has finished
-function setstatus()
-{
-   # set status values
-   resetstatusvalues
+# function evaluating the statusvalues
+function evalstatus()
+{
    case $@ in 
       start)   echo "setstatus start"
@@ -233,4 +231,12 @@
                ;;
    esac
+}
+
+# function calling the macro to set the status, after a process has finished
+function setstatusroot()
+{
+   # set status values
+   resetstatusvalues
+   evalstatus $@
 
 #   printstatusvalues
@@ -260,8 +266,4 @@
 function getstepinfo()
 {
-   if [ "$singleprocess" = "yes" ]
-   then 
-      column=${scriptscolname[$i]}
-   fi
    table=`grep "$column:" $steps | sed -e "s/[.]$column://" -e 's/#//' -e 's/ //g'`
    coltab=`grep "$column:" $steps | sed -e 's/://' -e 's/#//' -e 's/ //g'`
@@ -275,8 +277,13 @@
 }
 
+# function to get todolist
 function gettodo()
 {
    echo "getting todo..."
    getdbsetup 
+   if [ "$singleprocess" = "yes" ]
+   then 
+      column=${scriptscolname[$i]}
+   fi
    getstepinfo
    # get query
@@ -304,5 +311,9 @@
    fi
 #   echo " QUERY: "$query
-   process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "`
+   if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "`
+   then
+      echo "ERROR could not query process from db -> contex"
+      contex
+   fi
 
    if [ "$process" = "" ]
@@ -329,2 +340,38 @@
    fi
 }
+
+# function to set status of a process in the db
+function setstatus()
+{
+   resetstatusvalues
+   evalstatus $@
+
+   echo "setting todo..."
+   getdbsetup 
+   getstepinfo
+   # get query
+   reset=`grep "$coltab[.]Reset:" $steps | sed -e "s/$coltab[.]Reset://" -e 's/ //g'`
+   echo -$reset-
+   if [ "$reset" = "no" ]
+   then
+      echo "YOU CAN'T RESET $column for $var2!!!" 
+      finish
+   fi
+   query=" update $table set $column=$statustime"
+   if ! echo $influences | grep '#' > /dev/null 
+   then 
+      for influence in $influences
+      do 
+         query=$query", $influence=NULL"
+      done
+   fi
+   query=$query", fStartTime=$starttime, fFailedTime=$failedtime, fFailedCode=$failedcode, fFailedCodeAdd=$failedcodeadd, fReturnCode=$returncode "
+   query=$query" where $primary=$var2"
+   echo " QUERY: "$query
+   if ! mysql -s -u $us --password=$pw --host=hercules $db -e " $query "
+   then 
+      echo "ERROR could not insert status into db -> exit"
+      finish
+   fi
+
+}
