![]() |
![]() |
Optimizing JDBC performance in an appletOnce you have created your applet using WebLogic/JDBC, you will want to do some fine tuning to improve performance. One consideration in optimizing performance is how you use JDBC connections. There is a trade-off between keeping a client's connection open to the WebLogic Server and the database -- which may cause you to run out of server-side resources -- and closing and reopening the client's connection to the database for each query, which requires a few seconds. This can be particularly troublesome if you have many applet clients and not enough database connections to the DBMS server available. The WebLogic Server offers several possible solutions to this problem. The first thing you should consider is using WebLogic connection pools. Connection pools are a collection of open connections maintained on the WebLogic Server. Whenever you open a WebLogic/JDBC connection, WebLogic will use one of the pool connections rather than making a time-consuming DBMS connection. When you close the JDBC connection, it is returned to the pool for reuse. Therefore, you can open a JDBC connection for each query without a major performance hit. Connection pools also have the advantage of allowing you to limit the number of DBMS server connections, which can improve management of DBMS resources. Next you should decide whether you want to maintain an open a connection to the WebLogic Server between queries or whether you wish to open the WebLogic Server connection right before you open the JDBC connection and then close it right after closing the JDBC connection. Here are the advantages and disadvantages of each approach. Maintain a connection to the WebLogic Server
If you have clients that make many fast queries, you might choose the first approach. If you have applets that only occasionally make long queries to the database, the second approach might be better. |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|