newNode.setProperty("sysName", "X");
// BEFORE SAVING, issue a query that will NOT use the index. The query should not see the transient node ...
String queryStr = "select BASE.* FROM [" + typeName + "] as BASE WHERE NAME(BASE) = 'SOMENODE'";
Query query = jcrSql2Query(queryStr);
validateQuery().rowCount(0L).useNoIndexes().validate(query, query.execute());
// Now issue a query that will use the index. The query should not see the transient node...
queryStr = "select BASE.* FROM [" + typeName + "] as BASE WHERE BASE.sysName='X'";
query = jcrSql2Query(queryStr);
validateQuery().rowCount(0L).useIndex("ntsome2sysname").validate(query, query.execute());