You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Guillaume Bort <gu...@zenexity.fr> on 2005/07/21 16:56:28 UTC

Berkeleydb persistence, and Spring support

Hi all,

I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition. 

I think that this persistence manager might be a good alternative to CQFS.
It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
simple files.
Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.

It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).

I have also worked on a jcr support for the spring framework. 
I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
It allows the use of spring declarative transactions for jcr operations.

You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/

regards.

guillaume bort.


Re: Berkeleydb persistence, and Spring support

Posted by Guillaume Bort <gu...@zenexity.fr>.
Brian,

> 1) you can either use jcr's regular jaas authentication or a
> pre-authenticated subject

Sounds interesting. I will take a look at your code for a
pre-authenticated subject.

> 2) the dao support class has only one callback method for both read-only
> and read-write access, and it does not require you to manually convert
> jcr exceptions.

Great. I have not implemented the callback and template parts of the
spring DAO support.

> perhaps we can merge the good ideas from both implementations and offer
> the final result as a contribution to spring? i'm not terribly
> interested in maintaining this code ;)

I'm agree.

> ps: is there a non-annotations way to specify transactions and/or a
> backport of annotations?

Yes, you can use declarative transactions without annotations support.

For example :

<bean id="transactionManager"
class="org.springframework.jcr.JcrTransactionManager">
    <property name="sessionFactory"><ref bean="sessionFactory" /></property>
</bean>

<bean id="myServiceTarget" class="serviceClass" />

<bean id="myService"
   class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager"><ref
bean="transactionManager"/></property>
    <property name="target"><ref bean="myServiceTarget"/></property>
    <property name="transactionAttributes">
        <props>
            <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
            <prop key="store*">PROPAGATION_REQUIRED</prop>
        </props>
    </property>
</bean>

You can also use annotations with java 1.4 and apache commons-attributes
(spring support it natively) but you should compile them with an ant task.

And there is http://backport175.codehaus.org/. But i never tried.

guillaume

> Guillaume Bort wrote:
>
>> I have also worked on a jcr support for the spring framework. I think
>> that it's more a contribution to the spring project, but I'd like
>> feedback from the jackrabbit users first.
>> The spring support provides a jcr session factory bean, a jcr
>> transaction manager implementing the spring PlatformTransactionManager
>> and an exception translator that converts jcr exceptions to spring data
>> access exceptions.
>> It allows the use of spring declarative transactions for jcr operations.
>
> nice! i've done something similar, but with slightly different features:
>
> 1) you can either use jcr's regular jaas authentication or a
> pre-authenticated subject
>
> 2) the dao support class has only one callback method for both read-only
> and read-write access, and it does not require you to manually convert
> jcr exceptions.
>
> 3) transactions are not managed
>
> you can see the source code at
> <http://svn.osafoundation.org/server/commons/trunk/spring/>.
>
> perhaps we can merge the good ideas from both implementations and offer
> the final result as a contribution to spring? i'm not terribly
> interested in maintaining this code ;)
>
> ps: is there a non-annotations way to specify transactions and/or a
> backport of annotations?
>



Re: Berkeleydb persistence, and Spring support

Posted by Brian Moseley <bc...@osafoundation.org>.
Guillaume Bort wrote:

> I have also worked on a jcr support for the spring framework. I think 
> that it's more a contribution to the spring project, but I'd like 
> feedback from the jackrabbit users first.
> The spring support provides a jcr session factory bean, a jcr 
> transaction manager implementing the spring PlatformTransactionManager 
> and an exception translator that converts jcr exceptions to spring data 
> access exceptions.
> It allows the use of spring declarative transactions for jcr operations.

nice! i've done something similar, but with slightly different features:

1) you can either use jcr's regular jaas authentication or a 
pre-authenticated subject

2) the dao support class has only one callback method for both read-only 
and read-write access, and it does not require you to manually convert 
jcr exceptions.

3) transactions are not managed

you can see the source code at 
<http://svn.osafoundation.org/server/commons/trunk/spring/>.

perhaps we can merge the good ideas from both implementations and offer 
the final result as a contribution to spring? i'm not terribly 
interested in maintaining this code ;)

ps: is there a non-annotations way to specify transactions and/or a 
backport of annotations?

Re: Berkeleydb persistence, and Spring support

Posted by Edgar Poce <ed...@gmail.com>.
Hi Guillaume 

On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
> Let me know how should i proceed to sign the CLA.

See http://www.apache.de/licenses/icla.txt

BR,
edgar

> 
> guillaume.
> 
>

Re: Berkeleydb persistence, and Spring support

Posted by Guillaume Bort <gu...@zenexity.fr>.
Stefan,

I will add maven support, put berkeleydb as a maven dependency, and put 
the source code under ASF licence.
Let me know how should i proceed to sign the CLA.

guillaume.


Stefan Guggisberg a écrit :

>hi guillaume,
>
>i had a quick look at the persistence manager code, 
>great job! 
>
>if you'd want to contribute it to jackrabbit i would be very 
>interested. i think it would make a great and very useful
>contribution. a couple of minor issues would have to be
>fixed first though. the source files would require the ASF 
>copyright notice header, the project should be mavenized,
>je.jar should be removed for licensing reasons and we 
>would also need a signed CLA from you.
>
>so please let me know if you want to contribute it.
>
>cheers 
>stefan
>
>On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
>  
>
>>Hi all,
>>
>>I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition.
>>
>>I think that this persistence manager might be a good alternative to CQFS..
>>It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
>>simple files.
>>Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.
>>
>>It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).
>>
>>I have also worked on a jcr support for the spring framework.
>>I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
>>The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
>>It allows the use of spring declarative transactions for jcr operations.
>>
>>You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/
>>
>>regards.
>>
>>guillaume bort.
>>
>>
>>    
>>


Re: Berkeleydb persistence, and Spring support

Posted by Stefan Guggisberg <st...@gmail.com>.
hi guillaume,

On 7/24/05, Guillaume Bort <gu...@zenexity.fr> wrote:
> Hi stefan,
> 
> I fixed required issues in my code.
> You can download it at
> http://www.zenexity.fr/~guillaume/shared/bdb-persistence.zip
> 
> I let you to integrate it into the jackrabbit source code.

excellent, thanks! i committed your code as is, with one little
modification: 
i replaced ThreadLocal.remove() with ThreadLocal.put(null) in order
to avoid jdk1.5 dependencies.

thanks again for your contribution!

cheers
stefan

> 
> cheers
> guillaume
> 
> Stefan Guggisberg a écrit :
> 
> >hi guillaume,
> >
> >i had a quick look at the persistence manager code,
> >great job!
> >
> >if you'd want to contribute it to jackrabbit i would be very
> >interested. i think it would make a great and very useful
> >contribution. a couple of minor issues would have to be
> >fixed first though. the source files would require the ASF
> >copyright notice header, the project should be mavenized,
> >je.jar should be removed for licensing reasons and we
> >would also need a signed CLA from you.
> >
> >so please let me know if you want to contribute it.
> >
> >cheers
> >stefan
> >
> >On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
> >
> >
> >>Hi all,
> >>
> >>I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition.
> >>
> >>I think that this persistence manager might be a good alternative to CQFS..
> >>It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
> >>simple files.
> >>Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.
> >>
> >>It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).
> >>
> >>I have also worked on a jcr support for the spring framework.
> >>I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
> >>The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
> >>It allows the use of spring declarative transactions for jcr operations.
> >>
> >>You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/
> >>
> >>regards.
> >>
> >>guillaume bort.
> >>
> >>
> >>
> >>
> 
>

Re: Berkeleydb persistence, and Spring support

Posted by Guillaume Bort <gu...@zenexity.fr>.
Hi stefan,

I fixed required issues in my code.
You can download it at 
http://www.zenexity.fr/~guillaume/shared/bdb-persistence.zip

I let you to integrate it into the jackrabbit source code.

cheers
guillaume

Stefan Guggisberg a écrit :

>hi guillaume,
>
>i had a quick look at the persistence manager code, 
>great job! 
>
>if you'd want to contribute it to jackrabbit i would be very 
>interested. i think it would make a great and very useful
>contribution. a couple of minor issues would have to be
>fixed first though. the source files would require the ASF 
>copyright notice header, the project should be mavenized,
>je.jar should be removed for licensing reasons and we 
>would also need a signed CLA from you.
>
>so please let me know if you want to contribute it.
>
>cheers 
>stefan
>
>On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
>  
>
>>Hi all,
>>
>>I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition.
>>
>>I think that this persistence manager might be a good alternative to CQFS..
>>It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
>>simple files.
>>Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.
>>
>>It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).
>>
>>I have also worked on a jcr support for the spring framework.
>>I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
>>The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
>>It allows the use of spring declarative transactions for jcr operations.
>>
>>You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/
>>
>>regards.
>>
>>guillaume bort.
>>
>>
>>    
>>


Re: Berkeleydb persistence, and Spring support

Posted by Stefan Guggisberg <st...@gmail.com>.
hi guillaume,

i had a quick look at the persistence manager code, 
great job! 

if you'd want to contribute it to jackrabbit i would be very 
interested. i think it would make a great and very useful
contribution. a couple of minor issues would have to be
fixed first though. the source files would require the ASF 
copyright notice header, the project should be mavenized,
je.jar should be removed for licensing reasons and we 
would also need a signed CLA from you.

so please let me know if you want to contribute it.

cheers 
stefan

On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
> Hi all,
> 
> I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition.
> 
> I think that this persistence manager might be a good alternative to CQFS.
> It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
> simple files.
> Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.
> 
> It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).
> 
> I have also worked on a jcr support for the spring framework.
> I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
> The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
> It allows the use of spring declarative transactions for jcr operations.
> 
> You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/
> 
> regards.
> 
> guillaume bort.
> 
>

Re: Berkeleydb persistence, and Spring support

Posted by David Nuescheler <da...@gmail.com>.
hi guillaume,

> We are working on a full portal solution, including an innovative jsr168
> portal engine and a set of content oriented applications (online content
> publication, document management, workgroups, discussion spaces). The
> portal engine uses the JCR to store it's structure and user preferences.
excellent. i think a content repository is an excellent choice for that ;)
hierarchical and all ;)

> Of course, most of our applications store their content into JCR too.
cool.

> We are using Jackrabbit as a JCR implementation and we are very happy
> with this one.
great to hear.

> One of our customer will soon switch into production environment and we
> want to backup/restore the data store easily.
> Another point is that when customers ask how data are stored, I think
> they will be more confident if we answer 'into a berkeleydb database'
> than 'directly on filesystem'. (However I think it should not be a
> problem to store them directly in a descent filesystem in production
> environment).
;)

> A part of our portal solution will be opensourced soon.
looking forward to that...

thanks for all the infos, it is great to hear about good applications of jcr.

regards,
david

Re: Berkeleydb persistence, and Spring support

Posted by Guillaume Bort <gu...@zenexity.fr>.
David,

We are working on a full portal solution, including an innovative jsr168 
portal engine and a set of content oriented applications (online content 
publication, document management, workgroups, discussion spaces). The 
portal engine uses the JCR to store it's structure and user preferences. 
Of course, most of our applications store their content into JCR too.

We are using Jackrabbit as a JCR implementation and we are very happy 
with this one.

One of our customer will soon switch into production environment and we 
want to backup/restore the data store easily.
Another point is that when customers ask how data are stored, I think 
they will be more confident if we answer 'into a berkeleydb database' 
than 'directly on filesystem'. (However I think it should not be a 
problem to store them directly in a descent filesystem in production 
environment).

A part of our portal solution will be opensourced soon.

Guillaume.

David Nuescheler a écrit :

>hi guillaume,
>
>sounds great. thanks a lot for the information.
>the pm sounds very interesting, and i agree that this may
>well be an interesting alternative to cqfs.
>
>i assume that you have a particular application as the reason to 
>build this.
>can you tell us more about the application and the requirements
>that you needed to cover?
>
>regards,
>david
>
>On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
>  
>
>>Hi all,
>>
>>I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition.
>>
>>I think that this persistence manager might be a good alternative to CQFS..
>>It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
>>simple files.
>>Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.
>>
>>It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).
>>
>>I have also worked on a jcr support for the spring framework.
>>I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
>>The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
>>It allows the use of spring declarative transactions for jcr operations.
>>
>>You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/
>>
>>regards.
>>
>>guillaume bort.
>>
>>
>>    
>>
>
>
>  
>


Re: Berkeleydb persistence, and Spring support

Posted by David Nuescheler <da...@gmail.com>.
hi guillaume,

sounds great. thanks a lot for the information.
the pm sounds very interesting, and i agree that this may
well be an interesting alternative to cqfs.

i assume that you have a particular application as the reason to 
build this.
can you tell us more about the application and the requirements
that you needed to cover?

regards,
david

On 7/21/05, Guillaume Bort <gu...@zenexity.fr> wrote:
> Hi all,
> 
> I have finished a first implementation of a berkeleydb persistence manager that uses berkeleydb java edition.
> 
> I think that this persistence manager might be a good alternative to CQFS.
> It is largely inspired by the ObjectPersistenceManager except that it stores serialized objects as database entries instead of
> simple files.
> Others advantages are a set of tools to dump/load/verify the database, and a really atomical write of the changelog.
> 
> It passes the same tests as the original ObjectPersistenceManager and performances are almost identical (sometimes better).
> 
> I have also worked on a jcr support for the spring framework.
> I think that it's more a contribution to the spring project, but I'd like feedback from the jackrabbit users first.
> The spring support provides a jcr session factory bean, a jcr transaction manager implementing the spring PlatformTransactionManager and an exception translator that converts jcr exceptions to spring data access exceptions.
> It allows the use of spring declarative transactions for jcr operations.
> 
> You can download theses two packages at http://www.zenexity.fr/~guillaume/shared/
> 
> regards.
> 
> guillaume bort.
> 
> 


-- 
----------------------------------------------------------------------
http://jcr.day.com JSR-170 in Action!
---------------------------------------< david.nuescheler@day.com >---

This message is a private communication. If you are not the intended
recipient, please do not read, copy, or use it, and do not disclose it
to others. Please notify the sender of the delivery error by replying
to this message, and then delete it from your system. Thank you.

The sender does not assume any liability for timely, trouble free,
complete, virus free, secure, error free or uninterrupted arrival of
this e-mail. For verification please request a hard copy version.


mailto:david.nuescheler@day.com
http://www.day.com

David Nuescheler
Chief Technology Officer
Day Software AG
Barfuesserplatz 6 / Postfach
4001 Basel
Switzerland

T  41 61 226 98 98
F  41 61 226 98 97