jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Eggerling-Boeck" <paulbo...@yahoo.com>
Subject Re: XA Transaction question
Date Thu, 01 Mar 2007 16:06:32 GMT
Thanks Dominique,

I followed the instructions for Tomcat 5.5 on the Model 2 deployment
instructions page.  I copied and pasted the XML elements verbatim and
changed the configFilePath and repHomeDir appropriately.

I also copied the .jars listed below into [tomcat home]/common/lib:
jcr-1.0.jar
jackrabbit-api-1.2.1.jar
jackrabbit-core-1.2.1.jar
jackrabbit-index-filters-1.2.1.jar
concurrent-1.3.4.jar
derby-10.2.1.6.jar
jackrabbit-webdav-1.2.1.jar
jackrabbit-jcr-commons-1.2.1.jar
log4j-1.2.8.jar
jackrabbit-jcr-server-1.2.1.jar
commons-httpclient-3.0.jar
xmlParserAPIs-2.0.2.jar
commons-collections-3.1.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
lucene-core-2.0.0.jar
commons-codec-1.2.jar
xercesImpl-2.6.2.jar
jackrabbit-jcr-rmi-1.2.1.jar
jcl104-over-slf4j-1.0.jar
slf4j-log4j12-1.0.jar

On 3/1/07, Dominique Pfister <dominique.pfister@day.com> wrote:
> Hi Paul,
>
> you're right, session.save() will either save all or nothing, so you
> don't really need transactions here. But just out of curiosity - and
> because and I don't think anything is wrong with your sample code -
> can you tell me how you set up your repository in the JNDI context?
>
> Kind regards
> Dominique
>
>
> On 2/28/07, Paul Eggerling-Boeck <paulboeck@yahoo.com> wrote:
> > I read the Jackrabbit FAQ about transactions and have implemented
> > something like the following:
> >
> > InitialContext context = new InitialContext();
> > Context environment = (Context) context.lookup("java:comp/env");
> > Repository repository = (Repository) environment.lookup("jcr/repository");
> > XASession session = (XASession)repository.login(new
> > SimpleCredentials("username", "password".toCharArray()), null);
> >
> > XAResource xares = session.getXAResource();
> >
> > // XID stuff from FAQ is next
> >
> > xares.start(xid, XAResource.TMNOFLAGS);
> > // Create some nodes and properties
> > session.save();
> > xares.end(xid, XAResource.TMSUCCESS);
> > xares.rollback(xid);
> >
> > Note that I'm testing a rollback here so there's no xares.prepare() or
> > xares.commit();
> >
> > My problem is that the changes get persisted and not rolled back.  I'm
> > not using a UserTransaction or any transaction manager, just going at
> > the XAResource directly.  I read in the archives that the
> > session.save() method is all-or-nothing in and of itself so do I
> > really even need to do XA transactions if I just want to make sure all
> > my changes to the session are persisted as a unit?
> >
> > Am I doing something wrong?  Anybody else run into this?
> >
> > BTW, I'm using
> > org.apache.jackrabbit.core.fs.local.LocalFileSystem and
> > org.apache.jackrabbit.core.state.db.DerbyPersistenceManager
> >
> > Thanks,
> >
> > Paul
> >
>

Mime
View raw message