/*
 * 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.dboe.transaction;

import org.apache.jena.dboe.jenax.Txn;
import org.apache.jena.query.ReadWrite;
import org.apache.jena.query.TxnType;

/** Interface that encapsulates the  begin/abort|commit/end operations.
 * <p>The read lifecycle is:
 * <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.
 * <p>
 * Helper code is available {@link Txn} so, for example:
 * <pre>Txn.execRead(dataset, ()-> { ... sparql query ... });</pre> 
 * <pre>Txn.execWrite(dataset, ()-> { ... sparql update ... });</pre>
 * <p>
 * Directly called, code might look like:
 * <pre>
 *     Transactional object = ...
 *     object.begin(ReadWrite.READ);
 *     try {
 *       ... actions inside a read transaction ...
 *     } finally { object.end(); }
 * </pre>
 * or
 * <pre>
 *     Transactional object = ...
 *     object.begin(ReadWrite.WRITE);
 *     try {
 *        ... actions inside a write transaction ...
 *        object.commit();
 *     } finally {
 *        // This causes an abort if {@code commit} has not been called.
 *        object.end();
 *     }
 * </pre>
 * Exceptions will not be thrown.
 * If any do occur, this indicates serious internal problems with the transaction system.
 */
public interface Transactional extends org.apache.jena.sparql.core.Transactional
{
   /** Start either a READ or WRITE transaction */
   @Override
   public default void begin(ReadWrite readWrite) { 
       begin(TxnType.convert(readWrite));
   }
   
   @Override
   public void begin(TxnType type);
   
   /** Attempt to promote a read transaction to a write transaction.
    * This is not guaranteed to succeed - any changes by another write transaction
    * may restrict promotion.  This depends on the transaction type as to whether
    * it is "read commited" or not.
    * <p>
    * If not "read committed", any intervening write transaction will block promotion.
    * Otherwise, at the point or promotion, changes by other writers become visible. 
    * <p>
    * Promoting a transaction which is already a write transaction will return true. 
    * 
    * @return boolean indicating whether the transaction is now a write transaction or not.
    */
   @Override
   public boolean promote();

   /** Commit a transaction - finish the transaction and make any changes permanent (if a "write" transaction) */
   @Override
   public void commit();
   
   /** Abort a transaction - finish the transaction and undo any changes (if a "write" transaction) */  
   @Override
   public void abort();
   
   /** Finish the transaction - if a write transaction and commit() has not been called, then abort. */
   @Override
   public void end();
   
   /** Return the current mode of the transaction - "read" or "write" */ 
   @Override
   public ReadWrite transactionMode();

   /** Return the transaction type used in {@code begin(TxnType)}. */ 
   @Override
   public TxnType transactionType();
   
   /** Say whether inside a transaction. */ 
   @Override
   public boolean isInTransaction();
}
@@ -847,3109 +847,206 @@
 n;%0A%0A
-import org.apache.jena.dboe.jenax.Txn;%0Aimport org.apache.jena.query.ReadWrite;%0Aimport org.apache.jena.query.TxnType;%0A%0A/** Interface that encapsulates the  begin/abort%7Ccommit/end operations.%0A * %3Cp%3EThe read lifecycle is:%0A * %3Cpre%3E begin(READ) ... end()%3C/pre%3E%0A * %3Cp%3E%7B@code commit%7D and %7B@code abort%7D are allowed. %0A * %3Cp%3EThe write lifecycle is:%0A * %3Cpre%3E begin(WRITE) ... abort() or commit()%3C/pre%3E%0A * %3Cp%3E%7B@code end()%7D is optional but preferred.%0A * %3Cp%3E%0A * Helper code is available %7B@link Txn%7D so, for example:%0A * %3Cpre%3ETxn.execRead(dataset, ()-%3E %7B ... sparql query ... %7D);%3C/pre%3E %0A * %3Cpre%3ETxn.execWrite(dataset, ()-%3E %7B ... sparql update ... %7D);%3C/pre%3E%0A * %3Cp%3E%0A * Directly called, code might look like:%0A * %3Cpre%3E%0A *     Transactional object = ...%0A *     object.begin(ReadWrite.READ);%0A *     try %7B%0A *       ... actions inside a read transaction ...%0A *     %7D finally %7B object.end(); %7D%0A * %3C/pre%3E%0A * or%0A * %3Cpre%3E%0A *     Transactional object = ...%0A *     object.begin(ReadWrite.WRITE);%0A *     try %7B%0A *        ... actions inside a write transaction ...%0A *        object.commit();%0A *     %7D finally %7B%0A *        // This causes an abort if %7B@code commit%7D has not been called.%0A *        object.end();%0A *     %7D%0A * %3C/pre%3E%0A * Exceptions will not be thrown.%0A * If any do occur, this indicates serious internal problems with the transaction system.%0A */%0Apublic interface Transactional extends org.apache.jena.sparql.core.Transactional%0A%7B%0A   /** Start either a READ or WRITE transaction */%0A   @Override%0A   public default void begin(ReadWrite readWrite) %7B %0A       begin(TxnType.convert(readWrite));%0A   %7D%0A   %0A   @Override%0A   public void begin(TxnType type);%0A   %0A   /** Attempt to promote a read transaction to a write transaction.%0A    * This is not guaranteed to succeed - any changes by another write transaction%0A    * may restrict promotion.  This depends on the transaction type as to whether%0A    * it is %22read commited%22 or not.%0A    * %3Cp%3E%0A    * If not %22read committed%22, any intervening write transaction will block promotion.%0A    * Otherwise, at the point or promotion, changes by other writers become visible. %0A    * %3Cp%3E%0A    * Promoting a transaction which is already a write transaction will return true. %0A    * %0A    * @return boolean indicating whether the transaction is now a write transaction or not.%0A    */%0A   @Override%0A   public boolean promote();%0A%0A   /** Commit a transaction - finish the transaction and make any changes permanent (if a %22write%22 transaction) */%0A   @Override%0A   public void commit();%0A   %0A   /** Abort a transaction - finish the transaction and undo any changes (if a %22write%22 transaction) */  %0A   @Override%0A   public void abort();%0A   %0A   /** Finish the transaction - if a write transaction and commit() has not been called, then abort. */%0A   @Override%0A   public void end();%0A   %0A   /** Return the current mode of the transaction - %22read%22 or %22write%22 */ %0A   @Override%0A   public ReadWrite transactionMode();%0A%0A   /** Return the transaction type used in %7B@code begin(TxnType)%7D. */ %0A   @Override%0A   public TxnType transactionType();%0A   %0A   /** Say whether inside a transaction. */ %0A   @Override%0A   public boolean isIn
+public interface Transactional extends org.apache.jena.sparql.core.Transactional%0A%7B%0A    // Placeholder in case we need to add methods specific for DBOE/TDB2%0A    // before they migrate to sparql.core.
 Tran
@@ -1056,9 +1056,8 @@
 tion
-();
+al
 %0A%7D

Remove interface methods now in implemented geneally