You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2021/03/15 14:41:00 UTC

[GitHub] [jena] afs opened a new pull request #954: JENA-2004: Add application methods to Transactional

afs opened a new pull request #954:
URL: https://github.com/apache/jena/pull/954


   This PR adds operations to Transactional. They are default methods that call Txn.
   
   See #872 - this is that discussion where Txn is not deprecated or code calling it changed. 
   
   It means there complex code in the default methods.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs commented on pull request #954:
URL: https://github.com/apache/jena/pull/954#issuecomment-800635042


   (user error)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs commented on pull request #954:
URL: https://github.com/apache/jena/pull/954#issuecomment-800634189


   Sorry this has gone on for so long.
   
   I went back to this and investigated the relationship to jena-text. It's hard to untangle because jena-text is involved in the transaction and coordinates with Lucene.
   
   The contract for DatasetChanges is rather unclear - it predates full transaction support for all datasets.
   
   I've raised [JENA-2071](https://issues.apache.org/jira/browse/JENA-2071) to deprecate `DatasetChanges` so it can be removed from general use, freeing up space to do an "outside" transaction monitor with new, definite contract.
   
   If this is still relevant, or you have further thoughts, please add to the ticket [JENA-1656](https://issues.apache.org/jira/browse/JENA-1656).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs commented on pull request #954:
URL: https://github.com/apache/jena/pull/954#issuecomment-800107707


   From #872:
   An alternative design with TxnTrait (the default methods added separately) might be better. This leaves Transaction cleaner as an implementation API.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] rvesse commented on a change in pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
rvesse commented on a change in pull request #954:
URL: https://github.com/apache/jena/pull/954#discussion_r594413951



##########
File path: jena-arq/src/main/java/org/apache/jena/sparql/core/Transactional.java
##########
@@ -28,15 +30,17 @@
  * <pre> begin(READ) ... end()</pre>
  * <p>{@code commit} and {@code abort} are allowed.
  * <p>The write lifecycle is:
- * <pre> begin(WRITE) ... abort() or commit()</pre>
- * <p>{@code end()} is optional but preferred.
+ * <pre> begin(WRITE) ... abort() or commit() end()</pre>
+ * <p>{@code end()} is optional for "write" but is preferred.
  * <p>
- * Helper code is available {@link Txn} so, for example:
- * <pre>Txn.executeRead(dataset, {@literal ()->} { ... sparql query ... });</pre>
- * <pre>Txn.executeWrite(dataset, {@literal ()->} { ... sparql update ... });</pre>
- * or use one of <tt>Txn.calculateRead</tt> and <tt>Txn.executeWrite</tt>
+ * <h4>Application use</h4>
+ * Applications can conveniently execute the lifecycle with mthos to read or write:

Review comment:
       Typo: `mthos` -> `methods`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs commented on pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs commented on pull request #954:
URL: https://github.com/apache/jena/pull/954#issuecomment-799474476


   cc @rvesse @strangepleasures 
   
   I think this is the state of the discussions on #872.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs closed pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs closed pull request #954:
URL: https://github.com/apache/jena/pull/954


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs edited a comment on pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs edited a comment on pull request #954:
URL: https://github.com/apache/jena/pull/954#issuecomment-800107707


   From #872:
   An alternative design with `TxnTrait` (the default methods added separately) might be better. This leaves Transaction cleaner as an implementation API.
   
   ```
   public interface TxnTrait extends Transactional {
       public default void exec(TxnType txnType, Runnable r) {
           Txn.exec(this, txnType, r);
       }
   
       public default <X> X calc(TxnType txnType, Supplier<X> r) {
           return Txn.calc(this, txnType, r);
       }
   ...
   }
   ```
   then
   ```
   public interface Dataset extends TxnTrait
   ```
   On the other hand, the API for user/application is then more complicated.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org


[GitHub] [jena] afs merged pull request #954: JENA-2004: Add application methods to Transactional

Posted by GitBox <gi...@apache.org>.
afs merged pull request #954:
URL: https://github.com/apache/jena/pull/954


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org