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 2022/03/01 21:14:20 UTC

[GitHub] [jena] kinow commented on a change in pull request #1213: Miscellaneous

kinow commented on a change in pull request #1213:
URL: https://github.com/apache/jena/pull/1213#discussion_r817144465



##########
File path: jena-arq/src/main/java/org/apache/jena/sparql/core/TransactionalTrait.java
##########
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.core;
+
+import org.apache.jena.query.ReadWrite;
+import org.apache.jena.query.TxnType;
+
+/**
+ * Provide {@link Transactional} as an indirection to another {@link Transactional}.
+ *
+ * @apiNote Downside - the "getTxn" method is public. The alternative is
+ *     copy-and-paste. See the {@code ExTransactions} in the jena-examples module.
+ */
+public interface TransactionalTrait extends Transactional {
+    Transactional getTxn();
+    @Override default public void begin(TxnType txnType)        { getTxn().begin(txnType); }
+    @Override default public void begin(ReadWrite mode)         { getTxn().begin(mode); }
+    @Override default public void commit()                      { getTxn().commit(); }
+    @Override default public boolean promote(Promote txnType)   { return getTxn().promote(txnType); }
+    @Override default public void abort()                       { getTxn().abort(); }
+    @Override default public boolean isInTransaction()          { return getTxn().isInTransaction(); }
+    @Override default public void end()                         { getTxn().end(); }
+    @Override default public ReadWrite transactionMode()        { return getTxn().transactionMode(); }
+    @Override default public TxnType transactionType()          { return getTxn().transactionType(); }
+    default public boolean supportsTransactions()     { return true; }
+    default public boolean supportsTransactionAbort() { return false; }
+}

Review comment:
       Missing newline




-- 
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.

To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org

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