Chris,
Two things to watch out for:
1. Opening new connections. Each time you create a new connection to the
AS400 its going to cost, a lot. If you can open a single connection & reuse
it. If v5r3 supports connection pooling (earlier versions did not) then use
it, if v5r3 doesn't, then I would recommend you hold onto the connection
yourself.
2. Not using "prepared" statements. If you can structure your SQL so that it
uses parameter markers & prepare the statement before executing it. your
performance should improve.
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"MadMan2004" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Hello all!
|
| I'm having a problem with a project I'm working on and I'd like to ask
| for anyone's input that might be helpful. I'm building a rather large
| front-end application connecting to an AS400 for the back end database
| and I'm experiencing slow response times when executing sql statements.
| Some select statement response times are bad. Not all, but some. And
| there doesn't seem to be a consistent factor in any of the sql
| statements being so slow.
|
| Based on the application design, there's a group of components that get
| loaded dynamically which all access tables on the AS400. So it's very
| possible that the same sql statement will execute 40 or 50 times. My
| issue here is that for one execution of a select statement, it may take
| 50 - 200 milliseconds to execute. Cumulatively, assuming 50 executions
| of the statement, you're looking at a worse case scenario of 10 seconds
| (and it's even run longer, believe me). Even some INSERTs, UPDATEs and
| DELETEs are also slow.
|
| I'm using the iSeries Access v5r3 ole-db drivers. Keep in mind that
| these access times are slow even when there are no users on the box, so
| CPU usage is not an issue here. Although the slowdown becomes even
| more evident when the CPU is at 40% or higher.
|
| At this point the file sizes are very small (50-200 records in a file,
| and even less for lookup tables). The files are indexed according to
| the fields specified in the order of the where and order by clauses.
|
| Unfortunately I can't use the managed provider due to our legacy file
| structures using char for fields. The char field definition inherently
| has spaces after the end of it. It would muck up our code too much to
| trim each time we need to do a field comparison or a field assignment.
| The managed provider from ibm doesn't trim trailing spaces. The ole-db
| provider does trim trailing spaces.
|
| Does anyone have any idea why SQL on the AS400 is this slow for me? I
| have quite a bit of experience developing SQL Server applications in
| Vb.Net and I've never experienced poor response times like this.
|
| Can anyone direct me to a faster data provider? Or is there some
| tuning parameters I can use for IBM's AS400 provider?
|
| Any help would be very much appreciated.
|
| Thanks!
| Chris Voveris
| Programmer / Analyst
| Penn Software and Technology Services, Inc.
|