Issue Details (XML | Word | Printable)

Key: MULE-953
Type: Patch submission Patch submission
Status: Open Open
Priority: Minor Minor
Assignee: Massimo Lusetti
Reporter: Holger Hoffstaette
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Mule

File provider improvements for file transactions

Created: 03/Aug/06 08:54 PM   Updated: 10/May/07 10:02 PM
Component/s: Transport: File
Affects Version/s: 1.3-rc4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File FileProvider_1.patch (26 kB)

Issue Links:
Block
 

Includes test case?: no
Labels:


 Description  « Hide
Massimo has extended the file provider with support for commons-transactions; review the patch & check it in.

 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Massimo Lusetti added a comment - 04/Aug/06 04:20 AM
The patch apply from file provider project root

Massimo Lusetti added a comment - 11/Aug/06 08:54 AM
The error caused by testSend method in FileConnectorTestCase is related to the fact of FileResourceManager non completely initialized, since the initialization of FileResourceManager (from commons-transaction) is done in the doInitialize() method on the connector i don't understand why the testSend method should fail and the testDispatch method not.

Massimo Lusetti added a comment - 11/Aug/06 09:12 AM
new ver of the same patches getting read of FileSequencer

Holger Hoffstaette added a comment - 11/Aug/06 09:46 AM
One question: did you take any look at the classes in org.mule.util.file? It contains the beginnings of a supposedly transactional FileManager, but looks unfinished and is nowhere used (~ probably dead code) but I was wondering if you had looked at it maybe for integration with the regular Mule TX handling.

Massimo Lusetti added a comment - 11/Aug/06 10:00 AM
Not at all, I wasn't aware of their existance, if gnt@ is still around and would like to introduce that classes that would be very appreciated, i'm more then willing to drop or adjust the current integration with commons-transaction.
Thanks Holger for pointing, having file tx integrated with regular Mule TX is a big plus.

Holger Hoffstaette added a comment - 11/Aug/06 10:18 AM
I doubt that Guillaume has the time or interest, he's working for LogicBlaze (the company behind ServiceMix). In any case there's no reason to drop your patch at all! The code in org.mule.util.file is very much incomplete, but maybe you can have a look how it might be used together with your commons-transactions file stuff - maybe as an XA wrapper on top, or as a kind of "nested transaction".
To me reliable non-XA file handling is more important than flaky XA support that claims to be transactional but really isn't.

Massimo Lusetti added a comment - 11/Aug/06 12:21 PM
Andrew, Holger
Before i start digging through the code i would like to have your
opinion on the following question.

The comments on the org.mule.util.xa and org.mule.util.file packages
classes seems to reveal that the code is largely taken form
commons-transaction. I would like to know which is the best direction
to take in designing this integration, so, is it acceptable to have
mule-core to depend on commons-transaction and complete
org.mule.util.(xa|file) with direct integration with the CT api? Or is
better to stick the way the patch is (right now) and having only file
provider depends on CT?

And as a general hint, which is the best place where to place a single
instance of a class related to the connector class? I mean i would
like to have a single instance related to all the FileConnector
floating around MuleManager.


Ross Mason added a comment - 13/Aug/06 02:58 AM
My feeling is that we should duplicate code from commons-tx if a) the project is being maintained and b) that it works. I would prefer to add the dependency to the core and remove uncessary TX code from Mule.

As for the Singleton to be shared between connectors, that could be located on the TransactionCoordination object (which is a signleton used by transation support in Mule)

I think we'll need to address the Mule home-roled Queue Manager stuff to use the new Java Queue API, maybe we could also migrate the transaction code to commons-tx as the code is so similar anyway


Holger Hoffstaette added a comment - 13/Aug/06 11:31 AM
Just as reference: new Queues are MULE-710

Holger Hoffstaette added a comment - 18/Aug/06 11:19 AM
moving this off 1.3rc5 since it has to much impact. even if we only have CT in file-provider this is too much of a change for now, since if CT really goes into core we would have to change it again anyway. Maybe for 1.3 in file-provider only and then 1.4 overall but that depends on how quickly we get the TXManager/Queues done as per Ross' comment.

Massimo Lusetti added a comment - 22/Aug/06 11:49 AM
I have strong feeling about the patch to be completely broken, my mistake on understanding how CT is actually working, glad anybody have had a look at it
I'm about to starting new discussion on dev@ on this.

Massimo Lusetti added a comment - 25/Aug/06 07:58 PM
This completely replace the previous one.
Now we will get a FileResourceManager per endpoint address which will handle all transaction for the particular directory.
On the receiving part of the transport we need to find a method to get a "common root path" for the readDirectory and the moveDirectory (if moveToDirectory exist) since the FileResourceManager needs a common prefix (a directory called storeDir by FRM itself) which it will keep under its total control while outside that particular path it cannot operate, let think about it as a chroot environment.
So if a receiving endpoint address is /tmp/foo and has a moveToDirectory property value of /tmp/bar the common root path for the FRM will be /tmp and we will have two relative prefix for endpoint address (foo/) and for moveToDirectory (bar/).

Dispatcher are not affected by this boring issue.

Note about tests:
They pass all exept FileContentsMessageAdapterTestCase which fail with a NPE i think due to a non complete initialization of the connector/endpoint during test case execution. I could be wrong.


Holger Hoffstaette added a comment - 02/Sep/06 12:15 PM

Holger Hoffstaette added a comment - 30/Dec/06 08:24 AM

Holger Hoffstaette added a comment - 30/Dec/06 08:28 AM