org.eclipse.rdf4j.spring.resultcache.package-info Maven / Gradle / Ivy
Show all versions of rdf4j-spring Show documentation
/*******************************************************************************
* Copyright (c) 2021 Eclipse RDF4J contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/
/**
*
*
* Rdf4j-Spring ResultCache
*
* Automatically configures a cache for Rdf4J query results via the {@link org.eclipse.rdf4j.spring.RDF4JConfig
* Rdf4JConfig}.
*
*
* Enable via rdf4j.spring.resultcache.enabled=true
.
*
*
* If enabled, the {@link org.eclipse.rdf4j.spring.RDF4JConfig Rdf4JConfig} wraps the
* {@link org.eclipse.rdf4j.spring.support.connectionfactory.RepositoryConnectionFactory RepositoryConnectionFactory} in
* a {@link org.eclipse.rdf4j.spring.resultcache.CachingRepositoryConnectionFactory CachingRepositoryConnectionFactory},
* which wraps {@link org.eclipse.rdf4j.repository.RepositoryConnection RepositoryConnection}s in
* {@link org.eclipse.rdf4j.spring.resultcache.CachingRepositoryConnection CachingRepositoryConnection}s. These return
* {@link org.eclipse.rdf4j.spring.resultcache.ResultCachingGraphQuery ResultCachingGraphQuery} and
* {@link org.eclipse.rdf4j.spring.resultcache.ResultCachingTupleQuery ResultCachingTupleQuery} wrappers when
* instantiating queries. The
* ResultCaching(Tuple|Graph)Query
returns a Reusable(Tuple|Graph)QueryResult
, which records the
* results as they are read by the client code and keeps them for future use.
*
*
* There are two levels of caching: connection-level and global. The connection-level cache is cleared when the
* connection is closed (or returned to the pool, if pooling is enabled). The global cache is cleared whenever data is
* written to the repostitory by the application.
*
*
* Note: global result caching is disabled by default. The reason is that in the general case, we cannot be sure
* that no other application writes to the repository. If you are really sure that your application is the only
* one writing to the repository, or if the repository is read-only, you can enable the global result cache using
* rdf4j.spring.resultcache.assume-no-other-repository-clients=true
.
*
*
* For More information on configuration, see {@link org.eclipse.rdf4j.spring.resultcache.ResultCacheProperties
* ResultCacheProperties}
*
* @since 4.0.0
* @author Florian Kleedorfer
*/
package org.eclipse.rdf4j.spring.resultcache;