示例#1
0
 public virtual int ExecuteScript(Net.Vpc.Upa.Expressions.QueryScript script, bool exitOnError) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     if (closed)
     {
         throw new System.ArgumentException("Connection closed");
     }
     //ExecutionContext qlContext = createContext(ContextOperation.CREATE_PERSISTENCE_NAME);
     try {
         int max = script.Size();
         //            int groupPercent = 5;
         int errorsCount = 0;
         //            int group = (int) (((double) max * (double) groupPercent) / 100D);
         for (int i = 0; i < max; i++)
         {
             try {
                 ExecuteNonQuery(script.GetStatement(i), null, null);
             } catch (Net.Vpc.Upa.Exceptions.UPAException sqle) {
                 errorsCount++;
                 log.TraceEvent(System.Diagnostics.TraceEventType.Error, 100, Net.Vpc.Upa.Impl.FwkConvertUtils.LogMessageExceptionFormatter(nameDebugString + " [Error] executeNonQuery @" + i + " : " + script.GetStatement(i), sqle));
                 //                    log.log(Level.SEVERE,"Error @" + i + " : " + script.getStatement(i));
                 log.TraceEvent(System.Diagnostics.TraceEventType.Error, 100, Net.Vpc.Upa.Impl.FwkConvertUtils.LogMessageExceptionFormatter("{0} Error @{1} : {2}", null, new object[] { nameDebugString, i, script.GetStatement(i) }));
                 if (exitOnError)
                 {
                     throw sqle;
                 }
             }
         }
         //            if (listener != null) {
         //                listener.actionProgress(new ProgressEvent(this, null, null, max, 0L, max, parentEvent));
         //            }
         //            transactionSucceeded = true;
         return(errorsCount);
     } finally {
     }
 }
示例#2
0
 public virtual void AddScript(Net.Vpc.Upa.Expressions.QueryScript script)
 {
     if (script != null)
     {
         for (int i = 0; i < script.Size(); i++)
         {
             AddStatement(script.GetStatement(i));
         }
     }
 }