You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2006/03/18 14:34:02 UTC

[jira] Resolved: (JCR-313) Allow to configure DB persistence managers through JDNI

     [ http://issues.apache.org/jira/browse/JCR-313?page=all ]
     
Jukka Zitting resolved JCR-313:
-------------------------------

    Resolution: Fixed

Fixed in revisions 386838 - 386848. As described above, there are now abstract DatabasePersistenceManager and DatabaseFileSystem base classes that both contain an abstract getConnection() factory method (I refactored the initConnection() from JCR-355 as IMO it's cleaner the less subclasses know about base class internals) that subclasses need to implement. The existing "simple" subclasses implement this method using the JDBC DriverManager, and the added JNDI subclasses use a DataSource located using JNDI.

I also added a protected DatabasePersistenceManager.closeConnection() method to avoid having to override the full close() method in DerbyPersistenceManager. I haven't yet applied the same solution to the DatabaseFileSystem class as I think that there might be a better way to handle this. More on this on the mailing list.

I've added javadoc warnings about the long lifetime of the connections acquired by the database classes. This should cover Marcel's concerns at least somewhat, but I think that there is a better solution to this problem as well. Again, more soon on the mailing list.

> Allow to configure DB persistence managers through JDNI
> -------------------------------------------------------
>
>          Key: JCR-313
>          URL: http://issues.apache.org/jira/browse/JCR-313
>      Project: Jackrabbit
>         Type: Improvement
>     Versions: 0.9, 1.0
>     Reporter: Martin Perez
>     Assignee: Jukka Zitting
>      Fix For: 1.1
>  Attachments: dbpm-jndi.patch
>
> Currently, DB persistence managers have hardcoded urls. Even more, they will use a single connection with the drawbacks that this have regarding concurrency, performance and transactionality. 
> It would be fairly better to allow to configure DB persistence managers through JDNI references to DataSource. So giving responsability to application server. Concurrency, performance and transactionability will be highly boosted with this approach. 
> This could be a sample configuration :
> <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>        <param name="dataSource" value="jdbc/JackrabbitDS"/>
>         
>        .... think also about a way to pass params to data source, it should be simple ....
>        <param name="schema" value="mysql"/>
>        <param name="schemaObjectPrefix" value="${
> wsp.name}_"/>
>        <param name="externalBLOBs" value="false"/>
>    </PersistenceManager>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira