System and method for providing a second level connection cache for use with a database environment
First Claim
Patent Images
1. A system for providing a second-level connection cache for use with a database environment, comprising:
- a computer including a processor and a database;
an application server, wherein the application server includes a data source, wherein the data source is associated with a first-level data source connection cache, wherein the first-level data source connection cache includes at least one first-level database connection object, and wherein each first-level database connection object is attached to a session of the database;
a second-level connection cache, which caches a plurality of no-session connection objects, wherein each no-session connection object includes a socket to the database together with network protocol information, and wherein each no-session connection is unattached to any session of the database;
wherein, the data source receives a request for a connection from the software application;
wherein, if there is an idle first-level database connection object in the first-level database connection cache, then the data source returns the idle first-level database connection object to the software application in response to the request;
wherein, if each first-level database connection object in the first-level database connection cache is not idle and there is an idle no-session connection object in the second-level cache, then the system attaches a session of the database to the idle no-session connection object to form a complete connection object and returns the complete connection object to the software application in response to the request; and
wherein, if each first-level database connection object in the first-level database connection cache is not idle and each no-session connection object in the second-level cache is not idle, then the system creates an un-cached connection object and attaches a session of the database to the un-cached connection object to form a new un-cached connection object and returns the new un-cached connection object to the software application in response to the request.
1 Assignment
0 Petitions
Accused Products
Abstract
Described herein is a system and method for providing a level 2 connection cache for use with a database environment. In accordance with an embodiment, a second level, or level 2 (L2), connection cache is used to cache no-session connections for use with a database. When a connection is requested, a no-session connection (NSC) can be retrieved from the cache and a database session is attached. Later, when the connection is closed, the database session is logged off and the no-session connection returned to the cache for subsequent use.
37 Citations
13 Claims
-
1. A system for providing a second-level connection cache for use with a database environment, comprising:
-
a computer including a processor and a database; an application server, wherein the application server includes a data source, wherein the data source is associated with a first-level data source connection cache, wherein the first-level data source connection cache includes at least one first-level database connection object, and wherein each first-level database connection object is attached to a session of the database; a second-level connection cache, which caches a plurality of no-session connection objects, wherein each no-session connection object includes a socket to the database together with network protocol information, and wherein each no-session connection is unattached to any session of the database; wherein, the data source receives a request for a connection from the software application; wherein, if there is an idle first-level database connection object in the first-level database connection cache, then the data source returns the idle first-level database connection object to the software application in response to the request; wherein, if each first-level database connection object in the first-level database connection cache is not idle and there is an idle no-session connection object in the second-level cache, then the system attaches a session of the database to the idle no-session connection object to form a complete connection object and returns the complete connection object to the software application in response to the request; and wherein, if each first-level database connection object in the first-level database connection cache is not idle and each no-session connection object in the second-level cache is not idle, then the system creates an un-cached connection object and attaches a session of the database to the un-cached connection object to form a new un-cached connection object and returns the new un-cached connection object to the software application in response to the request. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for providing a connection cache for use with a database environment, comprising:
-
providing an application server, wherein the application server includes a data source, wherein the data source is associated with a first-level data source connection cache, wherein the first-level data source connection cache includes at least one first-level database connection object, and wherein each first-level database connection object is attached to a session of the database; providing a second-level connection cache, which caches a plurality of no-session connection objects, wherein each no-session connection object includes a socket to the database together with network protocol information, and wherein each no-session connection is unattached to any session of the database; if there is an idle first-level database connection object in the first-level database connection cache, then returning, by the data source, the idle first-level database connection object to the software application; if each first-level database connection object in the first-level database connection cache is not idle and there is an idle no-session connection object in the second-level cache, then attaching, by the system, a session of the database to the idle no-session connection object to form a complete connection object and returning the complete connection object to the software application; and if each first-level database connection object in the first-level database connection cache is not idle and each no-session connection object in the second-level cache is not idle, then creating, by system, an un-cached connection object and attaching a session of the database to the un-cached connection object to form a new un-cached connection object and returning the new un-cached connection object to the software application. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A non-transitory computer readable storage medium, including instructions stored thereon which when read and executed by one or more computers cause the one or more computers to perform the steps comprising:
-
providing an application server, wherein the application server includes a data source, wherein the data source is associated with a first-level data source connection cache, wherein the first-level data source connection cache includes at least one first-level database connection object, and wherein each first-level database connection object is attached to a session of the database; providing a second-level connection cache, which caches a plurality of no-session connection objects, wherein each no-session connection object includes a socket to the database together with network protocol information, and wherein each no-session connection is unattached to any session of the database; if there is an idle first-level database connection object in the first-level database connection cache, then returning, by the data source, the idle first-level database connection object to the software application; if each first-level database connection object in the first-level database connection cache is not idle and there is an idle no-session connection object in the second-level cache, then attaching, by the system, a session of the database to the idle no-session connection object to form a complete connection object and returning the complete connection object to the software application; and if each first-level database connection object in the first-level database connection cache is not idle and each no-session connection object in the second-level cache is not idle, then creating, by system, an un-cached connection object and attaching a session of the database to the un-cached connection object to form a new un-cached connection object and returning the new un-cached connection object to the software application.
-
Specification