public interface TransactionalWriter extends RowSetWriter
SyncProvider
抽象类的扩展使其具有更细粒度的事务控制。
如果一个或多个断开RowSet
对象参与全球事务,他们可能要协调同步致力于保护数据的完整性和减少同步异常数。如果是这种情况,应用程序应该设置CachedRowSet
恒COMMIT_ON_ACCEPT_CHANGES
到false
使用commit
和rollback
在这个接口中定义的方法来管理事务边界。
void commit() throws SQLException
acceptChanges
方法进行自上次调用的
commit
或
rollback
方法。此方法应仅在自动提交模式已禁用时使用。
SQLException
-如果一个数据库访问错误发生或这
CachedRowSet
对象在
Connection
对象是在自动提交模式
void rollback() throws SQLException
SQLException
-如果一个数据库访问错误发生或这
CachedRowSet
对象在
Connection
对象是在自动提交模式
void rollback(Savepoint s) throws SQLException
Savepoint
对象之前撤消所有更改在当前事务。此方法应仅在自动提交模式已禁用时使用。
s
-
Savepoint
对象标记在当前事务的保存点。在S被设置之前的所有更改都将被撤消。S被设置后的所有更改都将被永久性的。
SQLException
-如果一个数据库访问错误发生或
Connection
对象这
CachedRowSet
对象内是在自动提交模式
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.