Patent ID: 11947534
Assignee: ORACLE INTERNATIONAL CORPORATION
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 7:
8. A non-transitory machine readable medium storing one or more sequences of instructions for causing a server system to provide a shared connection pool, wherein execution of said one or more instructions by one or more processors contained in said server system causes performance of the actions of:
maintaining a plurality of physical connections, with each physical connection being a corresponding pool connection of a shared connection pool,
wherein each physical connection is established for communication at any time instance with only a single database instance of a plurality of database instances together implementing a distributed database;
maintaining a plurality of wait queues for said plurality of database instances, wherein each wait queue of said plurality of wait queues is used for queueing execution entities waiting for a corresponding database instance of said plurality of database instances;
maintaining an allocation table indicating whether or not a corresponding physical connection is established to a respective database instance of the plurality of database instances, and an association of the corresponding physical connection to the respective database instance;
receiving a first request from a first execution entity for a first end-to-end connection to a first database instance, wherein each end-to-end connection comprises one of said plurality of physical connections and a corresponding virtual connection from the requesting execution entity;
allocating said first end-to-end connection based on a first virtual connection and a first physical connection of said plurality of physical connections, wherein said first execution entity sends database queries directed to said distributed database on said first virtual connection of said first end-to-end connection;
receiving a second request, at a second time instance, from a second execution entity for a second end-to-end connection to a second database instance, wherein said first end-to-end connection is continued to be allocated to said first execution entity at said second time instance;
if, at said second time instance, said allocation table indicates that none of said plurality of physical connections is available for processing said second request to said second database instance:
queueing said second execution entity in a second wait queue of said plurality of wait queues at a third time instance following said second time instance, said second wait queue being associated with said second database instance, wherein presence of said second execution entity in said second wait queue indicates that said second end-to-end connection is not yet allocated to said second execution entity and said second execution entity is seeking to establish connection with said second database instance;
upon said first execution entity releasing said first end-to-end connection after said third time instance, checking whether there are execution entities waiting in a first wait queue of said plurality of wait queues associated with said first database instance,
wherein said first end-to-end connection is released after said first execution entity receives responses to said database queries;
if there are execution entities waiting in said first wait queue, allocating an additional end-to-end connection based on said first physical connection to one of said execution entities waiting in said first wait queue to enable said one of said execution entities to continue processing the corresponding request; and
if there are no execution entities waiting in said first wait queue, terminating said first physical connection to said first database instance, allocating said second end-to-end connection based on said first physical connection to said second database instance, and updating said allocation table to indicate that said first physical connection is now established to said second database instance.