1.0

Table Of Contents
Conflicting Operations
The current row of the result set cannot be changed by other transactions, because it will be locked with an update
lock. Result sets that are held open after a commit must move to the next row before allowing any operations
on it .
Some conicts may prevent the result set from doing updates and deletes. For example, if the current row is
deleted by a statement in the same transaction, then calls to ResultSet.updateRow() cause an exception
because the cursor is no longer positioned on a valid row.
Scrollable, Updatable Result Sets
A scrollable, updatable result set maintains a cursor that can both scroll and update rows.
SQLFire only supports Scrollable Insensitive Result Sets. To create a scrollable insensitive result set that is
updatable, you create the statement with concurrency mode ResultSet.CONCUR_UPDATABLE and type
ResultSet.TYPE_SCROLL_INSENSITIVE.
Examples of Scrollable, Updatable Result Sets on page 164
Visibility of Changes on page 164
Conicting Operations on page 165
Examples of Scrollable, Updatable Result Sets
Example of using result set update methods to update a row:
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = stmt.executeQuery(
"SELECT FIRSTNAME, LASTNAME, WORKDEPT, BONUS " +
"FROM EMPLOYEE");
uprs.absolute(5); // update the fifth row
int newBonus = uprs.getInt("BONUS") + 100;
uprs.updateInt("BONUS", newBonus);
uprs.updateRow();
Example of using ResultSet.deleteRow() to delete a row:
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = stmt.executeQuery(
"SELECT FIRSTNAME, LASTNAME, WORKDEPT, BONUS " +
"FROM EMPLOYEE");
uprs.last();
uprs.relative(-5); // moves to the 5th from the last row
uprs.deleteRow();
Visibility of Changes
Changes caused by other statements, triggers and other transactions (others) are considered as other changes,
and are not visible in scrollable insensitive result sets.
Own updates and deletes are visible in SQLFire scrollable insensitive result sets.
Note: SQLFire handles changes made using positioned updates and deletes as own changes, so when
made via a result set's cursor such changes are also visible in that result set.
vFabric SQLFire User's Guide164
Developing Applications with SQLFire