You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Marcel Stör <ma...@frightanic.com> on 2013/08/21 15:37:05 UTC

Replacement for JNDIDatabasePersistenceManager?

JNDIDatabasePersistenceManager has been deprecated for nearly three 
years now. However, looking at all the available bundled implementations 
and asking the search engine of my choice I wasn't able to find a PM 
that is based on a JNDI datasource.
How to go about this?

Cheers,
Marcel

-- 
Marcel Stör, http://frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Re: Replacement for JNDIDatabasePersistenceManager?

Posted by Marcel Stör <ma...@frightanic.com>.
On 22.08.2013 15:13, Jeroen Reijn wrote:
> The configuration looks like this:
>
> <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager">
>        <param name="driver" value="javax.naming.InitialContext"/>
>        <param name="url" value="java:comp/env/jdbc/repositoryDS"/>

Indeed, thanks a lot!

When I asked the search engine about 
org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager it 
turned up 
http://wiki.apache.org/jackrabbit/PersistenceManagerFAQ#Bundle_Database_PM 
and from there I found 
http://wiki.apache.org/jackrabbit/UsingJNDIDataSource.

-> "...support a JNDI data source in place of the JDBC driver and 
database URL"

<param name="driver" value="javax.naming.InitialContext"/> works just 
fine but it's certainly an ugly shortcut and everything but intuitive. 
There must be an 'instanceof' is 'isAssignable' somewhere in the source. 
Bingo... oaj.core.util.db.ConnectionFactory.createDataSource():

Class<?> driverClass = getDriverClass(driver);
if (driverClass != null && Context.class.isAssignableFrom(driverClass)) {
   ...
} else {
   return getDriverDataSource(driverClass, url, user, password);
}

Cheers,
Marcel

-- 
Marcel Stör, http://frightanic.com
Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Re: Replacement for JNDIDatabasePersistenceManager?

Posted by Jeroen Reijn <j....@onehippo.com>.
Hi Marcel,

AFAIK you use a JNDI datasource just fine. In a current project we're just
using JNDI for using a MySQL database.

The configuration looks like this:

    <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager">
      <param name="driver" value="javax.naming.InitialContext"/>
      <param name="url" value="java:comp/env/jdbc/repositoryDS"/>
      <param name="schemaObjectPrefix" value="${wsp.name}_"/>
      <param name="externalBLOBs" value="true"/>
      <param name="consistencyCheck" value="false"/>
      <param name="consistencyFix" value="false"/>
    </PersistenceManager>

Cheers,

Jeroen


On Wed, Aug 21, 2013 at 3:37 PM, Marcel Stör <ma...@frightanic.com> wrote:

> JNDIDatabasePersistenceManager has been deprecated for nearly three years
> now. However, looking at all the available bundled implementations and
> asking the search engine of my choice I wasn't able to find a PM that is
> based on a JNDI datasource.
> How to go about this?
>
> Cheers,
> Marcel
>
> --
> Marcel Stör, http://frightanic.com
> Couchsurfing: http://www.couchsurfing.com/**people/marcelstoer<http://www.couchsurfing.com/people/marcelstoer>
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>



-- 
Jeroen Reijn
Solution Architect
Hippo

Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 101 Main Street, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

http://about.me/jeroenreijn