[dna-issues] [JBoss JIRA] Commented: (DNA-582) The connector.execute(...) method is not 'all-or-nothing'
Randall Hauch (JIRA)
jira-events at lists.jboss.org
Sat Dec 12 13:36:30 EST 2009
[ https://jira.jboss.org/jira/browse/DNA-582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12499589#action_12499589 ]
Randall Hauch commented on DNA-582:
-----------------------------------
Changed the semantics of the RequestProcessor.close(). Previously, this method released all resources _and_ notified the observer of all changes. The resources always have to be released and thus close() must be called, yet this was always notifying the observer even in the case of change failures.
The close() method now no longer notifies the observer, and a new notifyObserverOfChanges() method has been added to do the notification. This makes it possible to always close the resources yet optionally do the notification depending upon other conditions.
The RequestProcessor.process(CompositeRequest) method behavior has also changed. Now, if there is an error on any of the change requests (any request that returns 'false' for isReadOnly()), the processing stops and the error is recorded.
The abstract MapRepositorySource has been changed to take advantage of this. A new MapRepositoryTransaction has been created, and the MapRepository now has a method to return a new transaction. The MapRepositoryConnection.execute(...) method has been changed to take advantage of this to obtain a transaction, perform the processing, check for errors on change requests, close the processor (to release any resources), and then either commit or rollback the transaction based upon whether the requests had errors and involved changes. Thus, the new MapRepositoryTransaction encapsulates all of the locking and rollback behavior for specializations of the MapRepository.
As part of DNA-585, the simple model in the JPA connector has been changed to use this transaction behavior and to commit or rollback the JPA transaction appropriately. The basic model in the JPA connector doesn't extend the MapRepository classes, but it does the same thing (using the JPA transaction directly in the connection's execute method). Therefore, this change should resolve DNA-585.
> The connector.execute(...) method is not 'all-or-nothing'
> ---------------------------------------------------------
>
> Key: DNA-582
> URL: https://jira.jboss.org/jira/browse/DNA-582
> Project: DNA
> Issue Type: Bug
> Components: Connectors, Graph
> Affects Versions: 0.7
> Reporter: Randall Hauch
> Priority: Blocker
> Fix For: 1.0
>
>
> The RepositoryConnector.execute(ExecutionContext,Request) method does not have all-or-nothing behavior. That is, if the request is a CompositeRequest with multiple requests to change the content, and some of those change requests result in errors, the execution should 'rollback' the changes and return the content to the state before the method was called. In other words, either all of the requests are fulfilled, or none of them are.
> None of the writable connectors work this way, and they all need to be corrected. Also, this behavior needs to be documented in the connector API. Finally, we need to make sure that the JCR session's transient state is unchanged if a save() call results in an error (the connector's state should rollback, but the session's state should remain, per Section 7.1.1.6-7.1.1.7 of JCR 1.0.1).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list