Forums de discussion

JackRabbit and default XMLPersistenceManager

thumbnail
Corné ., modifié il y a 16 années.

JackRabbit and default XMLPersistenceManager

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
Why is the default deployment of JCR/Jackrabbit with XMLPersistenceManager?

Where their documentation clearly states that
http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ

XMLPersistenceManager- status: obsolete, mature
- if the JVM process is killed the repository might turn inconsistent
- not meant to be used in production environments
- persists data in an abstract FileSystem using XML serialization format



<!--?xml version="1.0"?-->

<repository>
	<filesystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
		<param name="path" value="${rep.home}/repository">
	</filesystem>

	<!--
	Database File System (Cluster Configuration)

	This is sample configuration for mysql persistence that can be used for
	clustering Jackrabbit. For other databases, change the connection,
	credentials, and schema settings.
	-->

	<!--<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
		<param name="driver" value="com.mysql.jdbc.Driver"/>
		<param name="url" value="jdbc:mysql://localhost/jcr" />
		<param name="user" value="" />
		<param name="password" value="" />
		<param name="schema" value="mysql"/>
		<param name="schemaObjectPrefix" value="J_R_FS_"/>
	</FileSystem>-->

	<security appname="Jackrabbit">
		<accessmanager class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
		<loginmodule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
			<param name="anonymousId" value="anonymous">
		</loginmodule>
	</security>
	<workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="liferay" />
	<workspace name="${wsp.name}">
		<filesystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
			<param name="path" value="${wsp.home}">
		</filesystem>
		<persistencemanager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />

		<!--
		Database File System and Persistence (Cluster Configuration)

		This is sample configuration for mysql persistence that can be used for
		clustering Jackrabbit. For other databases, change the  connection,
		credentials, and schema settings.
		-->

		<!--<PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
			<param name="driver" value="com.mysql.jdbc.Driver" />
			<param name="url" value="jdbc:mysql://localhost/jcr" />
			<param name="user" value="" />
			<param name="password" value="" />
			<param name="schema" value="mysql" />
			<param name="schemaObjectPrefix" value="J_PM_${wsp.name}_" />
			<param name="externalBLOBs" value="false" />
		</PersistenceManager>
		<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
			<param name="driver" value="com.mysql.jdbc.Driver"/>
			<param name="url" value="jdbc:mysql://localhost/jcr" />
			<param name="user" value="" />
			<param name="password" value="" />
			<param name="schema" value="mysql"/>
			<param name="schemaObjectPrefix" value="J_FS_${wsp.name}_"/>
		</FileSystem>-->
	</workspace>
	<versioning rootpath="${rep.home}/version">
		<filesystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
			<param name="path" value="${rep.home}/version">
		</filesystem>
		<persistencemanager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />

		<!--
		Database File System and Persistence (Cluster Configuration)

		This is sample configuration for mysql persistence that can be used for
		clustering Jackrabbit. For other databases, change the connection,
		credentials, and schema settings.
		-->

		<!--<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
			<param name="driver" value="com.mysql.jdbc.Driver"/>
			<param name="url" value="jdbc:mysql://localhost/jcr" />
			<param name="user" value="" />
			<param name="password" value="" />
			<param name="schema" value="mysql"/>
			<param name="schemaObjectPrefix" value="J_V_FS_"/>
		</FileSystem>
		<PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
			<param name="driver" value="com.mysql.jdbc.Driver" />
			<param name="url" value="jdbc:mysql://localhost/jcr" />
			<param name="user" value="" />
			<param name="password" value="" />
			<param name="schema" value="mysql" />
			<param name="schemaObjectPrefix" value="J_V_PM_" />
			<param name="externalBLOBs" value="false" />
		</PersistenceManager>-->
	</versioning>

	<!--
	Cluster Configuration

	This is sample configuration for mysql persistence that can be used for
	clustering Jackrabbit. For other databases, change the  connection,
	credentials, and schema settings.
	-->
    <!--<Cluster id="node_1" syncDelay="5">
		<Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal">
			<param name="revision" value="${rep.home}/revision"/>
			<param name="driver" value="com.mysql.jdbc.Driver"/>
			<param name="url" value="jdbc:mysql://localhost/jcr"/>
			<param name="user" value=""/>
			<param name="password" value=""/>
			<param name="schema" value="mysql"/>
			<param name="schemaObjectPrefix" value="J_C_"/>
		</Journal>
    </Cluster>-->
</repository>

thumbnail
Corné ., modifié il y a 16 années.

RE: JackRabbit and default XMLPersistenceManager

Liferay Legend Publications: 1313 Date d'inscription: 03/10/06 Publications récentes
Either BundleDbPersistenceManager or BundleFsPersistenceManager are very fast if used with DataStore or BLOBStore
The data store was introduced in Jackrabbit 1.4, it's not available in the previous releases.

Liferay 442 uses JackRabbit 131

February 20, 2008: jackrabbit-core 1.4.1 releasedThis release fixes a binary property regression (JCR-1346) as well as other issues reported against the Apache Jackrabbit 1.4 release. Unlike previous Jackrabbit releases, this release only contains a single component.
See the downloads page for more details.

January 15, 2008: Apache Jackrabbit 1.4 releasedApache Jackrabbit 1.4 is an incremental feature release. While remaining compatible with previous releases, Jackrabbit 1.4 introduces a number of new features, improvements and fixes to known issues. The most notable new features in this releases are the new object mapping and service provider components for JCR. The Jackrabbit content repository implementation has been enhanced with a new storage model for binary content, a much improved query and indexing system, and many fixes and improvements especially for concurrent access. Many smaller improvements and bug fixes are also included all over the codebase.
See the downloads page for more details.

October 8, 2007: Apache Jackrabbit 1.3.3 releasedFrom the release notes: "Apache Jackrabbit 1.3.3 is patch release with bug fixes for features like concurrent versioning, journaling, and JCR API tests."
See the downloads page for more details.

Example of a BundleFsPersistenceManager
http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.html

http://jackrabbit.apache.org/api/1.4/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.html


<!--?xml version="1.0"?-->

<repository>

      <!-- [b] since JackRabbit 1.4  !!![/b]-->

    <datastore class="org.apache.jackrabbit.core.data.FileDataStore">
        <param name="path" value="${rep.home}/repository/datastore">
        <param name="minRecordLength" value="100">
    </datastore>


	<filesystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
		<param name="path" value="${rep.home}/repository">
	</filesystem>

	<security appname="Jackrabbit">
		<accessmanager class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
		<loginmodule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
			<param name="anonymousId" value="anonymous">
		</loginmodule>
	</security>
	<workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="liferay" />
	<workspace name="${wsp.name}">
		<filesystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
			<param name="path" value="${wsp.home}">
		</filesystem>
		
		<persistencemanager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
		</persistencemanager>

	</workspace>
	
	<versioning rootpath="${rep.home}/version">
		<filesystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
			<param name="path" value="${rep.home}/version">
		</filesystem>
	
	<persistencemanager class="org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager">
	</persistencemanager>

	</versioning>
</repository>
thumbnail
Brian Chan, modifié il y a 16 années.

RE: JackRabbit and default XMLPersistenceManager

Liferay Master Publications: 753 Date d'inscription: 05/08/04 Publications récentes
Ok, trunk (5.0.0) now uses Jackrabbit 1.4.1 and we replaced the default repository.xml from using:

org.apache.jackrabbit.core.state.xml.XMLPersistenceManager

to:

org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager

Thanks Corné
Carlos del Castillo, modifié il y a 15 années.

RE: JackRabbit and default XMLPersistenceManager

New Member Publications: 21 Date d'inscription: 28/08/08 Publications récentes
Is there any cluster sample configuration for Liferay 5.1 and jackrabbit 1.4?

We are deploying Liferay in two servers and we would like to have the jackrabbit repository redundant in both nodes. I saw the wiki page http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Clustering but is says that is for Liferay 4.

I tried that configuration but I'm having some problems with concurrent requests, some times I get the following exception, I'm using mysql with InnoDB engine:

15:31:16,273 ERROR [BasePersistenceImpl:52] Caught ORMException
15:31:16,274 ERROR [BasePersistenceImpl:60] com.liferay.portal.kernel.dao.orm.ORMException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
com.liferay.portal.kernel.dao.orm.ORMException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
	at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:41)
	at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:90)
	at com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistenceImpl.removeImpl(DLFileRankPersistenceImpl.java:131)
	at com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistenceImpl.remove(DLFileRankPersistenceImpl.java:111)
	at com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistenceImpl.removeByC_U_F_N(DLFileRankPersistenceImpl.java:1069)
	at com.liferay.portlet.documentlibrary.service.impl.DLFileRankLocalServiceImpl.updateFileRank(DLFileRankLocalServiceImpl.java:71)
	at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.getFileAsStream(DLFileEntryLocalServiceImpl.java:527)
thumbnail
Brian Scott Schupbach, modifié il y a 14 années.

RE: JackRabbit and default XMLPersistenceManagern

Expert Publications: 329 Date d'inscription: 23/10/08 Publications récentes
Hi,

I am receiving the same error which repeats until it eventually brings down our server. Have you resolved the error? Any help would be appreciated.

Thanks,

Brian