Subject | Re: Pooling Connection with FBWrappingDataSource |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-03-24T17:09:05Z |
> ¿How many connections must I have to make a good performance app?In theory equal to the number of concurrent accesses/transactions. But
experiment yourself. If you develop web application, use JMeter to
emulate site load and change size of the max connections in pool. And
you always can set it to 0, which means "no limit". In this case you
will have as much connections as you need (pool will be able to create
new when needed). But there's drawback - if you have connection leaks,
you will exaust your server.
> ¿How many statements or PreparedStatements per Connection must I do?As many as you need. If you use JayBird 1.5 from CVS, it will provide
your prepared statement pooling. In this case standard pattern would be:
PreparedStatement stmt = connection.prepareStatement(sql);
try {
...
} finally {
stmt.close();
}
Pool manage your statements and you have to not worry about statement
management (opening, closing, whether they survive commit or not, etc.)
> ¿How many max ResultSets or RowSets must I do?You always have one per statement. After you finished fetching data,
close it. Anyway, if you will re-use the statement it will be closed
automatically.
Roman