When do cached query results expire

How to control the expiration of the cached query results when using DFC query type DF_CACHE_QUERY? I have a dm_document successor "mytype" and I have updated the data many times since I performed the select for the first time, but the query still returns the original data. More than 5 minutes passed since then.
mytype has attributes: "s" and "i". Initially, s contained 'x', but now it contains 'y'. Yet, the program below prints 'x' every time it's launched.

public class MyDql2 {

    private static final Logger LOGGER = Logger.getLogger(MyDql2.class);

    public static void main(final String[] args) throws Exception {
        LOGGER.warn("start");
        DfLogger.debug(MyDql2.class, "DfLogger", null, null);

        final IDfClient cl = DfClient.getLocalClient();
        final String docbase = "docbas";
        final IDfSessionManager sm = cl.newSessionManager();

        final IDfLoginInfo info = new DfLoginInfo();
        info.setUser("admin");
        info.setPassword("s3cret");
        info.setSecurityMode(IDfLoginInfo.SECURITY_MODE_TRY_NATIVE_FIRST);
        sm.setIdentity(docbase, info);
        final IDfSession docses = sm.getSession(docbase);

        final String dql = "select * from mytype where i = 1";
        for (int i = 0; i < 3; i++) {
            final IDfCollection col = new DfQuery(dql).execute(docses, IDfQuery.DF_CACHE_QUERY);
            try {
                int j = 0;
                while (col.next()) {
                    j++;
                    LOGGER.info(col.getString("s"));
                }
            } finally {
                col.close();
            }
        }
        LOGGER.warn("ok");
    }
}

Comments

  • Did you try IDfQuery.setCurrencyCheckValue() ?

    Hicham Bahi
    Consulting Services
    OpenText

  • @bacham3 said:
    Did you try IDfQuery.setCurrencyCheckValue() ?

    Thanks, that's exactly what I was looking for.

Sign In or Register to comment.