Hello Ilja ,
the database I use is Oracle 9i. Ten concurrent users should be
ok. I was looking over the code of the JUnitPerf
test with some prof.
of mine today and we could not not make heads or tails out of
the akward result we got from the test. But we found some addional hints.
The problem seems to be the scheduler not the DB. When 10 users access the application ten instances of the databaseManagement class are created.
The difference between the two approaches is:
In case A (with sync keyword) one object is instantiated and its query
is processed. Same for the others.
In case B (without sync keyword) all ten objects are created at once and then each query is performed. This leads to performance issues.
I use a ConnectionPool which has 16 Connections at its disposal.
Access looks like this (simplified without Exception handling) :
public synchronized void loadHf(int ID_PR) throws SQLException
{
Connection c;
ResultSet r;
// gets Conn from DataSource
c = ServiceLocator.getInstance().getDBConn();
c.createStatement();
String sql = "....." ;
final PreparedStatement statement = c.prepareStatement(sql);
statement.setInt(1, ID_PR);
r= statement.executeQuery();
while (r.next())
{}
r.close();
statement.close();
c.close();
}
}
For the test I issue four queries for each user. Hope this clears things up.