System and method for reliable caching of database connections in a distributed application
First Claim
1. A system for managing connections between a server and a plurality of databases in a distributed object network in response to a server request to open a first connection and to a server request to release a second connection, the system comprising:
- a connection cache for storing information representing a plurality of connections;
opening apparatus cooperating with the connection cache which responds to the server open request by opening the first connection and storing information representing the first connection in the connection cache when the connection cache does not already contain information representing the first connection; and
releasing apparatus which cooperates with the connection cache and responds to the server release request by marking the second connection as unused.
2 Assignments
0 Petitions
Accused Products
Abstract
Connection information for open database connections is stored or “cached” in a connection manager at the database client. Therefore, even when a query is complete and the connection between the client and server is released, the manager maintains the database connection open. When a new query arrives at the client, the connection manager compares the connection information in the query to the corresponding information stored for each open connection. If there is a match and the connection is not in use, the already open connection is used for the new query. If there is no match, a new connection is opened until a predetermined limit of the number of connections is reached. When the limit is reached, an open connection which is not in use is closed and a new connection is established. In accordance with a preferred embodiment, a “free” list of open connections which are not in use is maintained so that a quick comparison can be made with the incoming query information.
98 Citations
24 Claims
-
1. A system for managing connections between a server and a plurality of databases in a distributed object network in response to a server request to open a first connection and to a server request to release a second connection, the system comprising:
-
a connection cache for storing information representing a plurality of connections;
opening apparatus cooperating with the connection cache which responds to the server open request by opening the first connection and storing information representing the first connection in the connection cache when the connection cache does not already contain information representing the first connection; and
releasing apparatus which cooperates with the connection cache and responds to the server release request by marking the second connection as unused. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A method for managing connections between a server and a plurality of databases in a distributed object network in response to a server request to open a first connection and to a server request to release a second connection, the method comprising the steps of:
-
(a) storing information representing a plurality of connections;
(b) opening the first connection in response to the server open request and storing information representing the first connection in the connection cache when the connection cache does not already contain information representing the first connection; and
(c) marking the second connection as unused in response to the server release request. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20)
(a1) re-using the first connection when the connection cache does contains information representing the first connection and the first connection is unused.
-
-
13. A method according to claim 12 wherein step (a1) further comprises the step of:
(a1a) marking the first connection as used.
-
14. A method according to claim 11 further comprising the step of:
2. selectively closing an open connection in response to the server open request when the connection cache is full.
-
15. A method according to claim 14 wherein step (d) further comprises the step of:
(d1) opening the first connection and storing information representing the first connection in the connection cache.
-
16. A method according to claim 11 further comprising the step of:
(e) storing information concerning all open and unused connections in a free list.
-
17. A method according to claim 16 wherein step (e) comprises the step of:
(e1) checking the free list in response to the server open request to determine whether the first connection is open and unused.
-
18. A method according to claim 16 wherein step (e) further comprises the step of:
(e2) adding information representing the second connection to the free list in response to the server release request.
-
19. A method according to claim 16 wherein the free list is implemented as a hash table.
-
20. A method according to claim 19 wherein step (e) further comprises the step of:
(e3) accessing the hash table by computing a hash value from connection information.
-
21. A computer program product for managing connections between a server and a plurality of databases in a distributed object network in response to a server request to open a first connection and to a server request to release a second connection, the computer program product comprising a computer usable medium having computer readable program code thereon, including:
-
program code for storing information representing a plurality of connections;
program code for opening the first connection in response to the server open request and storing information representing the first connection in the connection cache when the connection cache does not already contain information representing the first connection; and
program code for marking the second connection as unused in response to the server release request. - View Dependent Claims (22, 23, 24)
-
Specification