Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> oracle jdbc driver question
I have a server which makes database calls to retrieve resultset and
enumerates through the resultset to create objects (basically doing an OR
mapping) and return the objects. The server can be hit with n concurrent
users each on a separate thread. The db connections are pooled and I have
set the # of connections to be as high as the max possible concurrent users.
It seems when there is a large number of these connections being used
concurrently (my test case was 100 concurrent connections), the main
performance hit is in the resultset iteration (my test case has a moderately
large
number of records as well...500 for each of these 100 users). The fetch
method (called by resultset.next()) of the driver marshals and unmarshals
each batch of fetches and this (according to optimizeit) hogs the maximum
amount of CPU. Increasing the fetch size does not seem to have any
significant effect, and the memory used goes up pretty drastically. The
other problem area seems to be the resultset.getString. Unfortunately my
schema has a large number of strings, so I have to use this often for
mapping each row to an object.
Initially, when I saw gc kicking in frequently, I thought that since I am creating a large number of objects to map these 500 rows for each user, I am having this problem. But when I added in an object pool, so that I always have a constant number of objects to map to after the first run, I still have the same problem i.e. large time spent in resultset.next() and resultset.getString
I have somewhat optimized the database and it is now returning all the
queries in constant time.
But the time is spent most on the resultset maipulation.
When I brought down the number of open concurrent connections (and users not
getting
connections are now waiting till a connection is available back in the
pool), the performance improved
drastically. In my test cases, having 10 open concurrent connections seems
optimum when I have
100 concurrent users. I am using an oracle db (8.1.7) used locally.
Any ideas if this is a known problem with classes12.zip?
Thanks,
Shantanu Sen
Received on Sun Mar 10 2002 - 03:58:18 CST