Note Check the solidDB Release Notes for any limitations that are associated with using a grid in the current release.
Because, by default, the driver can route write transactions to only one grid node, it is recommended that you run only one write operation inside a database transaction or a set of write operations that affects only a single row.
Individual statements can affect multiple rows by using ranges, OR conditions, or IN lists in the WHERE clause. Although, it is theoretically possible to identify the node on which the primary partition for a row is hosted, and thus validate that a WHERE clause will only affect rows in the same grid node, this approach is not recommended.
Instead, it is recommended that you write your operations, so that only one row is updated in each transaction as shown in the following examples:
▪ The following transaction (in pseudo-code):
for (int i=0;i<10;i++) { insert into table values(,,,,); } commit();
could be rewritten as:
for (int i=0;i<10;i++) { insert into table values(,,,,); commit(); }
▪ The following transaction (in pseudo-code):
update table where key > 100 and key <= 200 commit();
could be rewritten as:
select partition_key from table where key > 100 and key <= 200; // fetch loop all keys // an array in the client
for (array of partition keys)
{ update table where partition_key = ?; commit(); }