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.