[
https://issues.apache.org/jira/browse/TRANSACTION-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513982
]
Peter Fassev commented on TRANSACTION-9:
----------------------------------------
Yes, tryLock make sense when locking a set of arbitrary resources prior to any
operation on it, and as Oliver said, it reduces the chance of a deadlock.
And I think it is possible to lock a not existing resource, because the locking
does not depend from the underlying file system. It all about Ids, and a not
created resource has an Id. Again, if you want to create a set of resource at
once, you may try to lock them first, and than execute the creation method
independently.
Sorry, for my insistence here, but I am talking about a resource management
systems in a multi user environment. Such scenarios are very common there. For
instance, think about of uploading a directory structure as a large ZIP-Archive
and than extracting all of it files. Or what about downloading a whole
directory structure as a ZIP-Archive...
One thought about directories: Adding a file to, renaming a file or deleting a
file from, or even changing a file in a directory actually changes the
structure of the directory. Before committing such changes, read lock on the
directory is not sufficient for this operation. The directory should have a
write lock, because somebody may try to read the children during the committing
operation (i.e. during the changes) and may become a inconsistent state of it.
So my attached implementation here is not quite gut on this point.
> [transaction] Add full file management capabilities to the FileResourceManager
> ------------------------------------------------------------------------------
>
> Key: TRANSACTION-9
> URL: https://issues.apache.org/jira/browse/TRANSACTION-9
> Project: Commons Transaction
> Issue Type: Improvement
> Environment: Operating System: All
> Platform: All
> Reporter: Peter Fassev
> Assignee: Oliver Zeigermann
> Priority: Minor
> Fix For: 2.0
>
> Attachments: filemanager.zip
>
>
> Hi,
> As stated in the doc the FileResourceManager is:
> "A resource manager for streamable objects stored in a file system"
> I agree, that this is a resource manager, but it could be easily extended, to
> support a full file management system. It will be very helpful to have
> additional methods like renameResource(), getResourceSize(),
> getResourceTime(),
> setResourceTime() etc. This are common file operations, which should be
> managed
> by the FileResourceManager.
> Further it will be very helpful to have (real) support for resource
> collections
> (folders). It will be necessary to distinguish between single resources
> (files)
> and collections (folders).
> Together, this features will enable a transactional access to any file based
> resources - for instance a document repository.
> Are there plans for such extensions and if not, will they actually fit in the
> goals of the transaction library?
> If not, please open the underlying structure, like the inner class
> TransactionContext, in order to add extensions the file management. For
> instance, it will be good to have a separate factory method, which creates
> the
> context.
> If you are interested in this proposal, I am ready to contribute to this
> project. I consider myself as an experienced java developer and I will be
> glad
> to help you.
> Best regards
> Peter Fassev
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]