Connecting AS400 data to ASP.NET

I have an application that will be in the business2business network, which will communicate with our AS400 in our internal network environment. The firewall is configured so that the data request is transmitted to our AS400, but we see a huge delay time in connection speed and response time. For example, what takes less than half a second in our local development environments takes about 120 seconds in our B2B environment.

This is the function we use to get our data. We use application blocks for corporate libraries, so the ASI object is a database ...

/// <summary> /// Generic function to retrieve data table from AS400 /// </summary> /// <param name="sql">SQL String</param> /// <returns></returns> private DataTable GetASIDataTable(string sql) { DataTable tbl = null; HttpContext.Current.Trace.Warn("GetASIDataTable(" + sql + ") BEGIN"); using (var cmd = ASI.GetSqlStringCommand(sql)) { using (var ds = ASI.ExecuteDataSet(cmd)) { if (ds.Tables.Count > 0) tbl = ds.Tables[0]; } } HttpContext.Current.Trace.Warn("GetASIDataTable() END"); return tbl; } 

I am trying to discuss some ideas to understand why this is happening.

+4
source share
3 answers

They had never used ASP.NET or AS400 in anger, but I had seen similar behavior before and usually pointed out some kind of network problem, usually a reverse DNS lookup that turned off.

Assuming you have activated ping through your firewall, verify that you can ping in both directions.

Also run traceroute from each machine to try to diagnose where there might be a delay.

Hope this helps.

+2
source

Sorry, but I can’t tell you what is happening, but I have a couple of comments ... First I would output sql, see if it has a lot of connections and / or hits a table (file) with a lot of records. If you really want to dig into your choice profiler (I use Ants Profiler) and try to find a profiler for 400 - see What server resources are, as well as the actual request after it passes through the odbc driver.

I have worked with asp.net and as400 several times, and the way I was most successful actually uses a SQL server with an associated server with AS400. I created a view to simplify the job of hiding the weird names of as400 names. In my scenario, it worked well, because the application in any case needed to retrieve information from the sql server.

I thought I mentioned this if that helps ... good luck.

+1
source

Check the size of your iSeries system. Depending on the size of the request, and if the system is not suitable for applications running on it, this may take some time. Although it should not be thrown away as an opportunity, I have seen similar behavior in the past. But most likely this is a network problem.

Another idea, if you can solve a performance problem or a size problem, is to save it to MS SQL Server and then write the records from SQL Server to iSeries.

0
source

All Articles