Is it to be expected that t-values from a Log.txRange(fromT, toT) can be non-continuous (ex 1650, 1651, 1653…)?
1 Like
In the test below I would expect the last t
to be 1002:
package datomic.samples;
import datomic.Connection;
import datomic.Peer;
import java.util.concurrent.ExecutionException;
import static datomic.Peer.tempid;
import static datomic.Util.list;
import static datomic.Util.map;
public class Test {
public static void main(String[] args) throws ExecutionException, InterruptedException {
String uri = "datomic:mem://localhost:4334/test";
Peer.createDatabase(uri);
Connection conn = Peer.connect(uri);
conn.transact(list(map(
":db/ident", ":ns/attr",
":db/valueType", ":db.type/long",
":db/cardinality", ":db.cardinality/one"))).get();
System.out.println(conn.db().basisT()); // 1000
conn.transact(list(map(":db/id", tempid(":db.part/user"), ":ns/attr", 1))).get();
System.out.println(conn.db().basisT()); // 1001
conn.transact(list(map(":db/id", tempid(":db.part/user"), ":ns/attr", 2))).get();
System.out.println(conn.db().basisT()); // 1003 - expected 1002
}
}
My bad. Documentation makes no guarantees of a continuous series of t
values. Only “consistent succession”:
A point in time in a database. Every transaction is assigned a numeric t value greater than any previous t in the database, and all processes see a consistent succession of ts. A transaction value t can be converted to a tx id with Peer.toTx.