You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Stefan Guggisberg <st...@gmail.com> on 2005/08/12 17:44:27 UTC

example db-based persistence manager

folks,

i added a example for a db-based persistence manager in the
contrib/db-persistence directory.
i wouldn't recommend it for production use, it's thought as an
example/proof of concept to demonstrate the following points:

- simple (if not to say primitive;) schema, using custom bianry serialization 
  format (-> ObjectPersistenceManager) 
- generic
- automatic schema creation (easy deployment)
- transactional 
- ok performance

i successfully tested it with mysql & mssql.

basic docu copied from java doc:

SimpleDbPersistenceManager is a generic JDBC-based PersistenceManager
for Jackrabbit that persists ItemState and NodeReferences objects
using a simple custom serialization format and a very basic
non-normalized database schema (in essence tables with one 'key' and
one 'data' column).

It is configured through the following properties:
- driver: the FQN name of the JDBC driver class
- url: the database url of the form jdbc:subprotocol:subname
- user: the database user
- password: the user's password
- schema: type of schema to be used (e.g. mysql, mssql, etc.);
- schemaObjectPrefix: prefix to be prepended to schema objects
             The required schema objects are automatically created by
executing the DDL
             statements read from the [schema].ddl file. The .ddl file
is read from the resources
             by calling getClass().getResourceAsStream(schema +
".ddl"). Every line in the
             specified .ddl file is executed separatly by calling 
             java.sql.Statement.execute(String) where every occurence
of the the string
             "${schemaObjectPrefix}" has been replaced with the value
of the property
             schemaObjectPrefix.

The following is a fragment from a sample configuration:
<PersistenceManager
             class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
     <param name="driver" value="com.mysql.jdbc.Driver"/>
     <param name="url" value="jdbc:mysql:///test"/>
     <param name="schema" value="mysql"/>
     <param name="schemaObjectPrefix" value="${wsp.name}_"/>
</PersistenceManager>
   

have fun,
cheers

stefan

Re: example db-based persistence manager

Posted by "deepak.singhvi@gmail.com" <de...@gmail.com>.
Yes i knew it that its an old post.
1) Do you have any place where examples related to DB File system with
oracle or mysql are available?
2) Is there any repository which contains examples about all the features of
jackrabbit?


Thanks
Deepak

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/example-db-based-persistence-manager-tp524814p4655573.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: example db-based persistence manager

Posted by Stefan Guggisberg <st...@gmail.com>.
On Thu, Jun 21, 2012 at 2:58 PM, deepak.singhvi@gmail.com
<de...@gmail.com> wrote:
> I am not able to find this example.

you're replying to a 7 year old post, we've moved forward in the meantime ;)

> Could you please help me with the link.

you can find it in svn, see [0]. please note that SimpleDbPersistenceManager
has been deprecated.

cheers
stefan

[0] http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/SimpleDbPersistenceManager.java

>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/example-db-based-persistence-manager-tp524814p4655558.html
> Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Re: example db-based persistence manager

Posted by "deepak.singhvi@gmail.com" <de...@gmail.com>.
I am not able to find this example.
Could you please help me with the link.

--
View this message in context: http://jackrabbit.510166.n4.nabble.com/example-db-based-persistence-manager-tp524814p4655558.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.