public interface TransactionalWriter extends RowSetWriter
SyncProvider抽象类,使其具有更细粒度的事务控制。
如果一个或多个断开的RowSet对象正在参与全局事务,则他们可能希望协调其同步提交以保持数据完整性并减少同步异常的数量。 如果是这种情况,应用程序应将CachedRowSet常量COMMIT_ON_ACCEPT_CHANGES设置为false ,并使用此commit定义的commit和rollback方法来管理事务边界。
void commit()
throws SQLException
acceptChanges方法自commit或rollback方法最后一次调用以来执行的所有更改都将commit 。
只有当自动提交模式被禁用时,才应该使用此方法。
SQLException - 如果发生数据库访问错误或此
Connection对象中的
CachedRowSet对象处于自动提交模式
void rollback()
throws SQLException
SQLException - 如果发生数据库访问错误或此
Connection对象内的
CachedRowSet对象处于自动提交模式
void rollback(Savepoint s) throws SQLException
Savepoint对象之前进行的当前交易中所做的所有更改。
只有当自动提交模式被禁用时,才应该使用此方法。
s - 在当前事务中标记一个保存点的Savepoint对象。
所有在设置之前进行的更改都将被撤销。
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.