Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/sql/rowset/spi/TransactionalWriter.java
38918 views
/*1* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.sql.rowset.spi;2627import java.sql.SQLException;28import java.io.Reader;2930import javax.sql.RowSetWriter;31import javax.sql.rowset.*;32import java.sql.Savepoint;3334/**35* A specialized interface that facilitates an extension of the standard36* <code>SyncProvider</code> abstract class so that it has finer grained37* transaction control.38* <p>39* If one or more disconnected <code>RowSet</code> objects are participating40* in a global transaction, they may wish to coordinate their synchronization41* commits to preserve data integrity and reduce the number of42* synchronization exceptions. If this is the case, an application should set43* the <code>CachedRowSet</code> constant <code>COMMIT_ON_ACCEPT_CHANGES</code>44* to <code>false</code> and use the <code>commit</code> and <code>rollback</code>45* methods defined in this interface to manage transaction boundaries.46*/47public interface TransactionalWriter extends RowSetWriter {4849/**50* Makes permanent all changes that have been performed by the51* <code>acceptChanges</code> method since the last call to either the52* <code>commit</code> or <code>rollback</code> methods.53* This method should be used only when auto-commit mode has been disabled.54*55* @throws SQLException if a database access error occurs or the56* <code>Connection</code> object within this <code>CachedRowSet</code>57* object is in auto-commit mode58*/59public void commit() throws SQLException;6061/**62* Undoes all changes made in the current transaction. This method should be63* used only when auto-commit mode has been disabled.64*65* @throws SQLException if a database access error occurs or the <code>Connection</code>66* object within this <code>CachedRowSet</code> object is in auto-commit mode67*/68public void rollback() throws SQLException;6970/**71* Undoes all changes made in the current transaction made prior to the given72* <code>Savepoint</code> object. This method should be used only when auto-commit73* mode has been disabled.74*75* @param s a <code>Savepoint</code> object marking a savepoint in the current76* transaction. All changes made before <i>s</i> was set will be undone.77* All changes made after <i>s</i> was set will be made permanent.78* @throws SQLException if a database access error occurs or the <code>Connection</code>79* object within this <code>CachedRowSet</code> object is in auto-commit mode80*/81public void rollback(Savepoint s) throws SQLException;82}838485