mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00

* Refactor READ ONLY mode in Context and adjust hibernate settings accordingly * Set Context in READ-ONLY mode when retrieving community lists * Fix Hibernate EHCache configuration + fix some Hibernate warnings * Cache authorized actions and group membership when Context is in READ-ONLY mode * Set default Context mode * Let ConfigurableBrowse use a READ-ONLY context * Add 2nd level cache support for Site and EPerson DSpaceObjects * Added 2nd level caching for Community and Collection * Fix tests and license checks * Cache collection and community queries * Small refactorings + backwards compatibility * Set Context to READ-ONLY for JSPUI submissions and 'select collection' step * OAI improvements part 1 * OAI indexing improvements part 1 * OAI indexing improvements part 2 * DS-3552: Only uncache resource policies in AuthorizeService when in read-only * DS-3552: Additional comment on caching handles * DS-3552: Fix cache leakage in SolrServiceResourceRestrictionPlugin * DS-3552: Clear the read-only cache when switching Context modes * DS-3552: Correct Group 2nd level cache size * DS-3552: Always clear the cache, except when going from READ_ONLY to READ_ONLY
59 lines
3.1 KiB
XML
59 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd" default-lazy-init="true">
|
|
|
|
<!-- Hibernate 4 Configuration -->
|
|
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" lazy-init="true">
|
|
<!-- Load most Hibernate settings from hibernate.cfg.xml -->
|
|
<property name="configLocation" value="file:${dspace.dir}/config/hibernate.cfg.xml"/>
|
|
<!-- Use the dataSource defined in the bean below. This is necessary so that Flyway can initialize
|
|
our database using the dataSource *prior* to Hibernate taking over -->
|
|
<property name="dataSource" ref="dataSource" />
|
|
<!-- Specify some additional Hibernate settings via dynamic properties. As noted below,
|
|
these values will be dynamically loaded from DSpace's ConfigurationService. -->
|
|
<!-- All other Hibernate settings are specified via the hibernate.cfg.xml referenced above. -->
|
|
<property name="hibernateProperties">
|
|
<props>
|
|
<prop key="hibernate.dialect">${db.dialect}</prop>
|
|
<prop key="hibernate.default_schema">${db.schema}</prop>
|
|
</props>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
|
|
<property name="targetClass" value="java.lang.System" />
|
|
<property name="targetMethod" value="setProperty" />
|
|
<property name="arguments">
|
|
<list>
|
|
<value>net.sf.ehcache.configurationResourceName</value>
|
|
<value>file:${dspace.dir}/config/hibernate-ehcache-config.xml</value>
|
|
</list>
|
|
</property>
|
|
</bean>
|
|
|
|
<bean id='dataSource'
|
|
class='org.springframework.jndi.JndiObjectFactoryBean'>
|
|
<description>
|
|
Try to look up the DataSource in JNDI. If not found, return a
|
|
DataSource built from connection details in the DSpace configuration.
|
|
</description>
|
|
<property name='jndiName' value='java:comp/env/jdbc/dspace'/>
|
|
<property name='defaultObject' ref='dspaceDataSource'/>
|
|
</bean>
|
|
|
|
<!-- NOTE: All of the properties which are used to configure the BasicDataSource are
|
|
dynamically loaded from DSpace's ConfigurationService. This is performed via
|
|
the Spring PropertyPlaceholderConfigurer configured by dspace-services
|
|
(see spring-dspace-core-services.xml). -->
|
|
<bean id="dspaceDataSource" class="org.apache.commons.dbcp2.BasicDataSource" lazy-init="true" destroy-method="close">
|
|
<property name="driverClassName" value="${db.driver}"/>
|
|
<property name="url" value="${db.url}"/>
|
|
<property name="username" value="${db.username}"/>
|
|
<property name="password" value="${db.password}"/>
|
|
<property name="maxWaitMillis" value="${db.maxwait}"/>
|
|
<property name="maxIdle" value="${db.maxidle}"/>
|
|
<property name="maxTotal" value="${db.maxconnections}"/>
|
|
</bean>
|
|
|
|
</beans> |