The only strange thing I see in your code is the following line

IgniteCache<Integer, ProtocolCache> cache =
Ignition.ignite().cache(CACHE_NAME); 

Here you get instance of a cache name CACHE_NAME, that according to the
generic holds ProtocolCache, but right after tries to query PersonCache
objects. Probably CACHE_NAME is not a valid one, please double-check that
this is not your case.

BTW, open CacheQueryExample, that is a part of Ignite, add the function
below to it and execute it

    private static void personsQuery() {
        IgniteCache<Integer, Person> cache =
Ignition.ignite().cache(PERSON_CACHE);

        String sql = "select * from Person";

        QueryCursor<Cache.Entry&lt;Integer, Person>> cursor =
cache.query(new SqlQuery<Integer,
            Person>(Person.class, sql));

        List<Cache.Entry&lt;Integer, Person>> cursResult = cursor.getAll();

        System.out.println("size persons = " + cursResult.size());
    }

Everything should work fine on your side and if it's so then I would
recommend you look into how the example works. Probably the example will
help you to find something that is missing on your side.

If nothing helps then please send me a reproducible example.

--
Denis



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Not-able-to-perform-cache-queries-tp2067p2071.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to