Forum Discussion

Blake_Bryce's avatar
Blake_Bryce
Occasional Contributor
8 years ago

listener could not hand off client connection after JavaScript conversion

We use successive database queries to be able to manipulate our app since TestComplete is not able to recognize certain grid objects(completely separate issue)

After about 20 successful calls back and forth I receive this error :
Error OraOLEDB ORA-12518: TNS:listener could not hand off client connection 

 

var connectionObject = ADO.CreateConnection();

 

connectionObject.connectionString = "Provider=Oracle Provider for OLE DB;" + "Password="+ProjectSuite.Variables.FCPASSWORD + ";Persist Security Info=True;" + "User ID="+ProjectSuite.Variables.FCUSERNAME + ";Data Source="+ProjectSuite.Variables.DATABASE;

 

connectionObject.Open(); //THIS IS WHERE THE ERROR IS GENERATED

 

var recordSet = Sys.OleObject("ADODB.Recordset");

 

recordSet.Open("select meter_class from fc_meter_class order by meter_class asc", connectionObject, 3); // 3 indicates static cursor

 

Delay(200, "Building list of Meter Classs in memory");

 

classArray = recordSet.GetString();

 

recordSet.Close();

 

I also call connectionObject.Close() at the end of this function.... The above code has been modified based on SmartBears user documentation for JavaScript, here is what works flawlessly with JScript:
var connectionObject = new ActiveXObject("ADODB.Connection");

 

var connectionString = "Provider=Oracle Provider for OLE DB;" + "Password="+ProjectSuite.Variables.FCPASSWORD + ";Persist Security Info=True;" + "User ID="+ProjectSuite.Variables.FCUSERNAME + ";Data Source="+ProjectSuite.Variables.DATABASE;

 

connectionObject.Open(connectionString);

var recordSet = new ActiveXObject("ADODB.Recordset");

 

recordSet.Open("select meter_class from fc_meter_class order by meter_class asc", connectionObject, 3); // 3 indicates static cursor

 

Delay(200, "Building list of Meter Classs in memory");

 

classArray = recordSet.GetString();

 

recordSet.Close();

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What it sounds like is that the connections are not actually getting closed.  While you are calling Connection.Close, it is entirely possible that it actually is not.  I know some database drivers have a maximum number of open connections before they start raising a stink. It sounds like you're running into that wall.

    Just for giggles, to try something out, see if the following code works in JavaScript

     

    var connectionObject = Sys.OleObject("ADODB.Connection");

    And then work through debugging your tests and make sure that your "close" call is getting called every time.