1. A system to provide query caching, comprising: one or more microprocessors; a query component, running on the one or more microprocessors, wherein the query component is deployed in a container and operates to issue a query to retrieve a query result from a database, wherein the query is associated with a transaction, and wherein the query result includes one or more instances of a class that is managed by the container, wherein the class represents one or more persisted data entries retrieved from the database and the one or more persisted data entries are associated with at least one row in a table in the database; a cache management component, running on the one or more microprocessors, to store the one or more instances of the class in a cache; a query registration component, running on the one or more microprocessors, to perform the steps of: maintaining the query in a query registry with one or more queries; looking up the query in the query registry; and allowing the cache management component to retrieve the stored one or more instances of the class for the query in the cache, when the query registration component determines that another query matches the query in the query registry; and wherein the cache management component further operates to allow the one or more instances of the class to be used concurrently by multiple users using an optimistic concurrency strategy, and wherein, under the optimistic concurrency strategy, the cache management component leaves the one or more instances of the class in the cached query result unlocked when the one or more instances of the class remain unchanged during the transaction; invalidate the one or more instances of the class in the cached query result that are used concurrently by multiple users during the transaction, when a row in the table in the database that is not used by the cached query result is updated or invalidated; and remove the query from the query registry and remove the cached query result with the one or more instances of the class from the cache.
8. The system according to claim 1 , wherein: the cache management component is further configured to at least one of: retrieve query result for a query in the cache by its key; select a query and removing its result from the cache; and invalidate the query result for a query in the cache.