Claims
- 1. A method of caching connections to a resource, comprising:
receiving a request for a connection to the resource specifying one or more attribute values, wherein available connections are stored in a cache; obtaining the connection to the resource from the cache if there is a connection in the cache that has attribute values that are a perfect match to the one or more attribute values specified in the request; and obtaining the connection to the resource from the cache if there is a connection that has attribute values that are a closest match to the one or more attribute values specified in the request, wherein each attribute has a weight and the closest match is determined by weighting the attribute values of the connection that match the one or more attribute values specified in the request.
- 2. The method of claim 1, further comprising opening a new connection to the resource if the perfect match or closest match to the one or more attribute values specified in the request is not found in the cache.
- 3. The method of claim 1, wherein whether to determine the closest match is specified as a property of the cache.
- 4. The method of claim 1, wherein weights of attributes are specified as a property of the cache.
- 5. The method of claim 1, further comprising calculating a match score for connections in the cache by weighting the attribute values of a connection that match the one or more attribute values specified in the request.
- 6. The method of claim 5, wherein the match score is the sum of weights of the attribute values of a connection that match the one or more attribute values specified in the request.
- 7. The method of claim 1, wherein the weight of an attribute corresponds to the expense of the attribute.
- 8. The method of claim 1, wherein the request for a connection to the resource specifies attribute name and value pairs.
- 9. The method of claim 1, wherein the perfect match is a connection that has only attribute values that perfectly match the one or more attribute values specified in the request.
- 10. The method of claim 1, wherein if a connection has an attribute value that does not match the one or more attribute values specified in the request, the connection cannot be the closest match.
- 11. The method of claim 1, wherein the resource is a database.
- 12. A computer program product that caches connections to a resource, comprising:
computer code that receives a request for a connection to the resource specifying one or more attribute values, wherein available connections are stored in a cache; computer code that obtains the connection to the resource from the cache if there is a connection in the cache that has attribute values that are a perfect match to the one or more attribute values specified in the request; computer code that obtains the connection to the resource from the cache if there is a connection that has attribute values that are a closest match to the one or more attribute values specified in the request, wherein each attribute has a weight and the closest match is determined by weighting the attribute values of the connection that match the one or more attribute values specified in the request; and computer readable medium that stores the computer codes.
- 13. The computer program product of claim 12, wherein the computer readable medium is a CD-ROM, floppy disk, tape, flash memory, system memory, hard drive, or data signal embodied in a carrier wave.
- 14. A database system, comprising:
a database that stores information; a cache that stores connections to the database; and a connection manager that receives a request for a connection to the resource specifying one or more attribute values; obtains the connection to the resource from the cache if there is a connection in the cache that has attribute values that are a perfect match to the one or more attribute values specified in the request; and obtains the connection to the resource from the cache if there is a connection that has attribute values that are a closest match to the one or more attribute values specified in the request, wherein each attribute has a weight and the closest match is determined by weighting the attribute values of the connection that match the one or more attribute values specified in the request.
- 15. A method of caching connections to a resource, comprising:
receiving a request for a connection to the resource specifying one or more attribute values, wherein each attribute has a weight; calculate a match score for connections in the cache by weighting the attribute values of a connection that match the one or more attribute values specified in the request; and obtaining the connection to the resource from the cache if there is a connection that has attribute values that are a closest match to the one or more attribute values specified in the request.
- 16. The method of claim 15, further comprising opening a new connection to the resource if the closest match to the one or more attribute values specified in the request is not found in the cache.
- 17. The method of claim 16, wherein the new connection does not have the one or more attribute values specified in the request.
- 18. The method of claim 15, wherein weights of attributes are specified as a property of the cache.
- 19. The method of claim 15, wherein the match score is the sum of weights of the attribute values of a connection that match the one or more attribute values specified in the request.
- 20. The method of claim 15, wherein the weight of an attribute corresponds to the expense of the attribute.
- 21. The method of claim 15, wherein the request for a connection to the resource specifies attribute name and value pairs.
- 22. The method of claim 15, wherein if a connection has an attribute value that does not match the one or more attribute values specified in the request, the connection cannot be the closest match.
- 23. The method of claim 15, further comprising obtaining the connection to the resource from the cache if there is a connection in the cache that has attribute values that are a perfect match to the one or more attribute values specified in the request.
- 24. The method of claim 23, wherein the perfect match is a connection that has only attribute values that perfectly match the one or more attribute values specified in the request.
- 25. The method of claim 15, wherein the resource is a database.
- 26. A computer program product that caches connections to a resource, comprising:
computer code that receives a request for a connection to the resource specifying one or more attribute values, wherein each attribute has a weight; computer code that calculates a match score for connections in the cache by weighting the attribute values of a connection that match the one or more attribute values specified in the request; computer code that obtains the connection to the resource from the cache if there is a connection that has attribute values that are a closest match to the one or more attribute values specified in the request; and a computer readable medium that stores the computer codes.
- 27. The computer program product of claim 26, wherein the computer readable medium is a CD-ROM, floppy disk, tape, flash memory, system memory, hard drive, or data signal embodied in a carrier wave.
- 28. A database system, comprising:
a database that stores information; a cache that stores physical connections to the database; and a connection manager that receives a request for a connection to the resource specifying one or more attribute values, wherein each attribute has a weight; calculates a match score for connections in the cache by weighting the attribute values of a connection that match the one or more attribute values specified in the request; and obtains the connection to the resource from the cache if there is a connection that has attribute values that are a closest match to the one or more attribute values specified in the request.
RELATED APPLICATIONS
[0001] This application is related to U.S. application Ser. No. ______, filed ______ (attorney docket no. ORACP007) and U.S. application Ser. No. ______, filed ______ (attorney docket no. ORACP009), both of which are hereby incorporated by reference.