0N/A/*
2362N/A * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.sql.rowset.spi;
0N/A
0N/Aimport java.sql.SQLException;
0N/Aimport java.io.Reader;
0N/A
0N/Aimport javax.sql.RowSetWriter;
0N/Aimport javax.sql.rowset.*;
0N/Aimport java.sql.Savepoint;
0N/A
0N/A/**
0N/A * A specialized interface that facilitates an extension of the standard
0N/A * <code>SyncProvider</code> abstract class so that it has finer grained
0N/A * transaction control.
0N/A * <p>
0N/A * If one or more disconnected <code>RowSet</code> objects are particating
0N/A * in a global transaction, they may wish to coordinate their synchronization
0N/A * commits to preserve data integrity and reduce the number of
0N/A * sychronization exceptions. If this is the case, an application should set
0N/A * the <code>CachedRowSet</code> constant <code>COMMIT_ON_ACCEPT_CHANGES</code>
0N/A * to <code>false</code> and use the <code>commit</code> and <code>rollback</code>
0N/A * methods defined in this interface to manage transaction boundaries.
0N/A */
0N/Apublic interface TransactionalWriter extends RowSetWriter {
0N/A
0N/A /**
0N/A * Makes permanent all changes that have been performed by the
0N/A * <code>acceptChanges</code> method since the last call to either the
0N/A * <code>commit</code> or <code>rollback</code> methods.
0N/A * This method should be used only when auto-commit mode has been disabled.
0N/A *
0N/A * @throws SQLException if a database access error occurs or the
0N/A * <code>Connection</code> object within this <code>CachedRowSet</code>
0N/A * object is in auto-commit mode
0N/A */
0N/A public void commit() throws SQLException;
0N/A
0N/A /**
0N/A * Undoes all changes made in the current transaction. This method should be
0N/A * used only when auto-commit mode has been disabled.
0N/A *
0N/A * @throws SQLException if a database access error occurs or the <code>Connection</code>
0N/A * object within this <code>CachedRowSet</code> object is in auto-commit mode
0N/A */
0N/A public void rollback() throws SQLException;
0N/A
0N/A /**
0N/A * Undoes all changes made in the current transaction made prior to the given
0N/A * <code>Savepoint</code> object. This method should be used only when auto-commit
0N/A * mode has been disabled.
0N/A *
0N/A * @param s a <code>Savepoint</code> object marking a savepoint in the current
0N/A * transaction. All changes made before <i>s</i> was set will be undone.
0N/A * All changes made after <i>s</i> was set will be made permanent.
0N/A * @throws SQLException if a database access error occurs or the <code>Connection</code>
0N/A * object within this <code>CachedRowSet</code> object is in auto-commit mode
0N/A */
0N/A public void rollback(Savepoint s) throws SQLException;
0N/A}