I agree that this is the "prefered" way of doing things, but if you are 
creating objects that have no knowledge of each other, ie that are functionally 
independent,  then the ability to join a transaction is necessary.    

-----Original Message-----
From: MARENDY, Anthony [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 17, 2005 7:15 PM
To: 'Slide Users Mailing List'
Subject: RE: One transaction on several resources

I normally just use the same resource object, and move it around to point at 
different resources.

e.g. 
WebdavResource res = new WebdavResource(...); res.startTransaction('AAA', 
3600); try {
        // Do stuff.

        // Move to point at another resource.
        res.setPath(...);


        // Do stuff.

        // This will commit all of the changes to all of the resources affected 
by the res object.
        res.commitTransaction();
}
catch (Exception e) {
    // This will rollback the changes to all of the resources affected by the 
res object.
    res.abortTransaction();
}


Hope this helps,
Anthony.

> -----Original Message-----
> From: Ray Sprinkle [SMTP:[EMAIL PROTECTED]
> Sent: Monday, 17 October 2005 22:46
> To:   Slide Users Mailing List
> Subject:      RE: One transaction on several resources
> 
> 
> Jaime,
>       I use this solution to join a new WebdavResource to an existing 
> transaction on a previous WebdavResource.  I consider this to be a 
> hack and it may fail if certain Slide internals change, but it works for now.
> 
>       WebdavResource tranSrc = ...   // WebdavResource that has open
> transaction.
>       WebdavResource tranDst = ...     // WebdavResource that is joining
> transaction.
> 
>       // Try to add the new connection to the existing transaction.      
>       String tranHandle = tranSrc.getTransactionHandle();      
>       WebdavState wds = (WebdavState)
> tranDst.getSessionInstance(null).getState();
>       wds.setTransactionHandle(tranHandle);    
> 
> 
> You'll want to add lots of error checking.
> 
> 
> -----Original Message-----
> From: Jaime Fernández [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 17, 2005 7:12 AM
> To: slide-user@jakarta.apache.org
> Subject: One transaction on several resources
> 
> I have to make a transaction on several resources, for instance, I 
> want to create two files as a single transaction. I have had a look at 
> the slide API, and the transaction process is related to the 
> WebdavResource class, so you could commit each file but not both files as an 
> atomic operation.
> Is there anyway to get it?.
> Apart from that, what's the best approach: external transaction (with 
> JCA
> connector) or internal transactions (with startTransaction method)?.
> Thanks in advance.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-----------------------------------------------------------------------------------
This e-mail is sent by Suncorp-Metway Limited ABN 66 010 831 722 or one of its 
related entities "Suncorp". 

Suncorp may be contacted at Level 18, 36 Wickham Terrace, Brisbane or on 13 11 
55  or at suncorp.com.au.

The content of this e-mail is the view of the sender or stated author and does 
not necessarily reflect the view of Suncorp. The content, including 
attachments, is a confidential communication between Suncorp and the intended 
recipient. If you are not the intended recipient, any use, interference with, 
disclosure or copying of this e-mail, including attachments, is unauthorised 
and expressly prohibited. If you have received this e-mail in error please 
contact the sender immediately and delete the e-mail and any attachments from 
your system.

If this e-mail constitutes a commercial message of a type that you no longer 
wish to receive please reply to this e-mail by typing Unsubscribe in the 
subject line.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to