Hi,
I am getting below error when running AX routine for exporting data as BATCH JOB to Azure database using DSN connection.
ERROR:
Microsoft][SQL Server Native Client 11.0][SQL Server]Resource ID : 2. The session limit for the database is 300 and has been reached. See 'go.microsoft.com/fwlink' for assistance.
Object OdbcConnection could not created.
External SQL server database exist in Azure machine.
DSN connection is created in AOS server using Native client 11.0.
AX code is using this DSN and carrying out two operations.
First one is to create an ODBC connection, run the truncate table statement once.
Second operation is for the insert statement and it is under while loop.
ODBC connection is being created for each new insert statement.
Below is the code that is under the while loop of AX table
While select * from CustTable
{
odbcConnection = new OdbcConnection(this.getLoginProperty());
perm.assert();
statement = odbcConnection.createStatement();
statement.executeUpdate(sql);
statement.close();
}
There are more than 300 records in the AX table.
If I run this routine as batch job then I get the error mentioned above.
Is there a way to resolve this error?
Is there a way to have one ODBC connection and run multiple statements?
Any ideas to resolve this error will be appreciated.
Thanks
*This post is locked for comments