You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by harvey waters <ha...@googlemail.com> on 2007/07/04 11:00:21 UTC
Audit Trail
We're trying to implement an audit trail of activity, (who's adding content,
deleting e.t.c). Our first thought was to record the activity in a seperate
database but this means using distributed transactions. Has anyone been able
to use distributed transactions with JackRabbit ? or is there a much better
solution to the audit trail problem that we have completley missed.
Many Thanks Harvey
Re: Audit Trail
Posted by harvey waters <ha...@googlemail.com>.
Thanks for that I'll give it a go.
On 7/4/07, Christoph Kiehl <ch...@sulu3000.de> wrote:
>
> harvey waters wrote:
> > Sounds like we're trying to do something very similar (we're using
> spring
> > modules too). What transaction manager are you using, I'm a bit confused
> > about what the stack should look like if we're not running it in an
> > application server ?
>
> We don't run our app in an application server. See below for our xml
> config.
>
> Cheers,
> Christoph
>
> ================
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:aop="http://www.springframework.org/schema/aop"
> xmlns:tx="http://www.springframework.org/schema/tx"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
> http://www.springframework.org/schema/tx
> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
>
> <bean id="transactionManager"
> class="
> org.springmodules.jcr.jackrabbit.LocalTransactionManager">
> <property name="sessionFactory" ref="sessionFactory" />
> </bean>
>
> <tx:annotation-driven
> transaction-manager="transactionManager" />
>
> <bean id="jcrTemplate"
> class="org.springmodules.jcr.JcrTemplate">
> <property name="sessionFactory" ref="sessionFactory" />
> <property name="allowCreate" value="true" />
> <property name="exposeNativeSession" value="true" />
> </bean>
>
> <bean id="sessionFactory"
> class="org.springmodules.jcr.JcrSessionFactory">
> <property name="repository" ref="repository" />
> <property name="credentials">
> <bean class="javax.jcr.SimpleCredentials">
> <constructor-arg index="0" value="bogus"
> />
> <constructor-arg index="1"
> value="password" />
> </bean>
> </property>
> <property name="workspaceName" value="default" />
> </bean>
> </beans>
>
>
Re: Audit Trail
Posted by Christoph Kiehl <ch...@sulu3000.de>.
harvey waters wrote:
> Sounds like we're trying to do something very similar (we're using spring
> modules too). What transaction manager are you using, I'm a bit confused
> about what the stack should look like if we're not running it in an
> application server ?
We don't run our app in an application server. See below for our xml config.
Cheers,
Christoph
================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<bean id="transactionManager"
class="org.springmodules.jcr.jackrabbit.LocalTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven
transaction-manager="transactionManager" />
<bean id="jcrTemplate"
class="org.springmodules.jcr.JcrTemplate">
<property name="sessionFactory" ref="sessionFactory" />
<property name="allowCreate" value="true" />
<property name="exposeNativeSession" value="true" />
</bean>
<bean id="sessionFactory"
class="org.springmodules.jcr.JcrSessionFactory">
<property name="repository" ref="repository" />
<property name="credentials">
<bean class="javax.jcr.SimpleCredentials">
<constructor-arg index="0" value="bogus" />
<constructor-arg index="1" value="password" />
</bean>
</property>
<property name="workspaceName" value="default" />
</bean>
</beans>
Re: Audit Trail
Posted by harvey waters <ha...@googlemail.com>.
Sounds like we're trying to do something very similar (we're using spring
modules too). What transaction manager are you using, I'm a bit confused
about what the stack should look like if we're not running it in an
application server ?
On 7/4/07, Christoph Kiehl <ch...@sulu3000.de> wrote:
>
> harvey waters wrote:
>
> > Our other concern is around the transation managment, we're using an
> Open
> > Source stack tomcat/spring/springmodules/acegi/jackrabbit. The audit
> trail
> > requires that all our write operations are held in a transaction. Now I
> > know
> > that JackRabbit supports transactions but has anyone got an open source
> > stack to actually work with transactions or would it be better if I
> > deployed
> > jackrabbit into a full blown application server ? On ServerSide you
> > described JackRabbit as a bit 'rough around the edges' I'm kinda hoping
> > your
> > not including transaction management in that ?
>
> We successfully use springmodules jcr component together with springs
> transaction management. Springs transaction annotations are used for
> transaction
> demarcation and our DAOs all just extend
> org.springmodules.jcr.support.JcrDaoSupport. Works like a charm.
>
> Cheers,
> Christoph
>
>
Re: Audit Trail
Posted by Christoph Kiehl <ch...@sulu3000.de>.
harvey waters wrote:
> Our other concern is around the transation managment, we're using an Open
> Source stack tomcat/spring/springmodules/acegi/jackrabbit. The audit trail
> requires that all our write operations are held in a transaction. Now I
> know
> that JackRabbit supports transactions but has anyone got an open source
> stack to actually work with transactions or would it be better if I
> deployed
> jackrabbit into a full blown application server ? On ServerSide you
> described JackRabbit as a bit 'rough around the edges' I'm kinda hoping
> your
> not including transaction management in that ?
We successfully use springmodules jcr component together with springs
transaction management. Springs transaction annotations are used for transaction
demarcation and our DAOs all just extend
org.springmodules.jcr.support.JcrDaoSupport. Works like a charm.
Cheers,
Christoph
Re: Audit Trail
Posted by David Nuescheler <da...@gmail.com>.
hi harvey,
sorry for the delay and thanks to christophe for the additional information.
> On ServerSide you
> described JackRabbit as a bit 'rough around the edges' I'm kinda hoping your
> not including transaction management in that ?
my comment was really around what i would consider the "soft factors" like
nice and easy packaging, user documentation (beyond well documented
source code), etc...
i think the core of jackrabbit is extremely robust and scales well beyond my
expectations. i certainly at this point consider transactions being part of the
very well tested and frequently used core.
regards,
david
Re: Audit Trail
Posted by harvey waters <ha...@googlemail.com>.
Thanks for the comments david.
Our other concern is around the transation managment, we're using an Open
Source stack tomcat/spring/springmodules/acegi/jackrabbit. The audit trail
requires that all our write operations are held in a transaction. Now I know
that JackRabbit supports transactions but has anyone got an open source
stack to actually work with transactions or would it be better if I deployed
jackrabbit into a full blown application server ? On ServerSide you
described JackRabbit as a bit 'rough around the edges' I'm kinda hoping your
not including transaction management in that ?
On 7/4/07, David Nuescheler <da...@gmail.com> wrote:
>
> hi harvey,
>
> > We decided against it initially because the data is very simple and
> would't
> > require the overheads of versioning, security checking etc.
> the overhead of versioning and security checking etc. really only applies
> if it is used, so for example a node that is not versionable does not
> have versioning
> overhead. security probably might be an issue when it comes to read access
> to the audit trail, who knows...
>
> i think one should look at these features of a content repository as
> services that
> are exposed by the repository and if unused do not necessarily cause
> overhead,
> but can come in very handy when they become necessary.
>
> we actually decided to store our applications audit trail in the
> repository and i dont
> regret it. but i guess it all depends on data volume and the usecases in
> the
> application.
>
> regards,
> david
>
Re: Audit Trail
Posted by David Nuescheler <da...@gmail.com>.
hi harvey,
> We decided against it initially because the data is very simple and would't
> require the overheads of versioning, security checking etc.
the overhead of versioning and security checking etc. really only applies
if it is used, so for example a node that is not versionable does not
have versioning
overhead. security probably might be an issue when it comes to read access
to the audit trail, who knows...
i think one should look at these features of a content repository as
services that
are exposed by the repository and if unused do not necessarily cause overhead,
but can come in very handy when they become necessary.
we actually decided to store our applications audit trail in the
repository and i dont
regret it. but i guess it all depends on data volume and the usecases in the
application.
regards,
david
Re: Audit Trail
Posted by harvey waters <ha...@googlemail.com>.
We decided against it initially because the data is very simple and would't
require the overheads of versioning, security checking etc.
On 7/4/07, Bertrand Delacretaz <bd...@apache.org> wrote:
>
> On 7/4/07, harvey waters <ha...@googlemail.com> wrote:
> > We're trying to implement an audit trail of activity, (who's adding
> content,
> > deleting e.t.c). Our first thought was to record the activity in a
> seperate
> > database but this means using distributed transactions....
>
> Why not record the audit trail info in the repository?
>
> I'm doing this in one of our apps, using a separate tree which stores
> audit trail events under paths like
>
> /audittrail/2007/20070530/event-1
>
> It works well for me, and avoids the use of a different storage mechanism.
>
> -Bertrand
>
Re: Audit Trail
Posted by Bertrand Delacretaz <bd...@apache.org>.
On 7/4/07, harvey waters <ha...@googlemail.com> wrote:
> We're trying to implement an audit trail of activity, (who's adding content,
> deleting e.t.c). Our first thought was to record the activity in a seperate
> database but this means using distributed transactions....
Why not record the audit trail info in the repository?
I'm doing this in one of our apps, using a separate tree which stores
audit trail events under paths like
/audittrail/2007/20070530/event-1
It works well for me, and avoids the use of a different storage mechanism.
-Bertrand