Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
5 years ago
Solved

error in TE

I have a script prefectly run on my local machine with TC.

But if runs on TE at server machine  it gives error........

method is something like..

class revers():
..................................
............................................    
  def updatePay_Last(self):
    Delay(12000,'delay for a while')  #--------the error fired here------------
    Log.Message("Just Loggg")
    Log.Message(str(Project.Variables.VariableExists('RunNoCollect')))
    Log.Message( Project.Variables.GetVariableType('RunNoCollect'))
    Log.Message(str(Project.Variables.RunNoCollect.RowCount)+"........."+str(Project.Variables.RunNoCollect.ColumnCount))
    Log.Message( Project.Variables.GetVariableDescription('RunNoCollect'))
    Log.Message(str(Project.Variables.RunNoCollect.Item[1,2])+" is the problem child...........")
    MyVar = Project.Variables.RunNoCollect
    Iterator = MyVar.Iterator
    # Initializes the iterator
    Iterator.Reset()
    # Iterates through the rows 
    while not Iterator.IsEOF():
      # Returns the column name by its index 
      ColName = MyVar.ColumnName[1]
      # Retrieves values and posts them to the log     
      value = Iterator.Value[ColName]
      Log.Message(value)
      # Forwards the iterator to the next row 
      Iterator.Next()
      
    runNo = Project.Variables.RunNoCollect.Item[1,2]
   ..............
  ...................

def main():
  reversOBJ = revers()
.................................
....................................
  reversOBJ.checkYTDValues('Final')
  reversOBJ.updatePay02()
  reversOBJ.checkRun(Project.Variables.RunNoCollect.Item[1,1],'checkRun02')
  reversOBJ.updatePay_Last() # ---------this is where calling happens---------
  reversOBJ.checkRun(Project.Variables.RunNoCollect.Item[1,2],'checkRun03')
  reversOBJ.checkFinal()

but if I run below no problem...

def just_test():
  reversOBJ = revers()
  reversOBJ.updatePay_Last()

any idea is appreciated..

 

  • It might not be that it doesn't work in TE but more that the machine running TE may be having problems opening the connection.  I know for a fact that the method you're calling works just fine in both (I use it myself).  So, the next investigation point I'd look at is network connectivity to the SQL server from the remote TE box, possibly firewall or user permission issues or something like that.

8 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    My thought:

     

    While the error seems to come at that "Delay" call, I suspect, actually, that might be mistaken.  It seems that the error message is indicating that the error is happening on some sort of connection to an application which seems to be indicating the call BEFORE it... somethjing, perhaps, in checkrun.  Have you attempted to add some logging to the checkrun method to see what steps it fails at?

    • NisHera's avatar
      NisHera
      Valued Contributor

      tristaanogre  you are spot on..

      The checkrun method call database connection several times.

      after a while it could not further create ADO.CreateConnection() object.

      all previous connections closed properly after use.

       

      Is there any reason ADO.CreateConnection() dosn't  in TE but work in TC?

      is there possibility to  ADO.CreateConnection()  intract with DDT.Exceldriver ? 

      TC,TE, SQLServer are x64

       

       

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        It might not be that it doesn't work in TE but more that the machine running TE may be having problems opening the connection.  I know for a fact that the method you're calling works just fine in both (I use it myself).  So, the next investigation point I'd look at is network connectivity to the SQL server from the remote TE box, possibly firewall or user permission issues or something like that.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    What happens if you run it on TC on the server machine?

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        If you can run TE there,  you can run TC there.