no data by JDBC or Cache query!

classic Classic list List threaded Threaded
3 messages Options
Aurora Aurora
Reply | Threaded
Open this post in threaded view
|

no data by JDBC or Cache query!

This post was updated on .
CONTENTS DELETED
The author has deleted this message.
ibelyakov ibelyakov
Reply | Threaded
Open this post in threaded view
|

Re: no data by JDBC or Cache query!

Hello,

Could you please provide cache configuration for server nodes?

Regards,
Igor



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
slava.koptilin slava.koptilin
Reply | Threaded
Open this post in threaded view
|

Re: no data by JDBC or Cache query!

In reply to this post by Aurora
Hi,

Please make sure that your types are registered as follows:
    CacheConfiguration<String, Person> ccfg = new CacheConfiguration<>("PersonCache");
    ccfg.setIndexedTypes(String.class, Person.class);
    ...
    IgniteCache<String, Person> personCache = igniteClient.getOrCreateCache(ccfg); 


Thanks,
S.

чт, 14 мар. 2019 г. в 10:47, Aurora <[hidden email]>:
Ignite 2.7.0
I poured data by the following code, but I didnt get  data after executing
jdbc or cache query, while I just can see data by "cache -scan -c=@c4" by
the command window: IgniteVisorCmd.sh. why?

IgniteCache<String, Person> personCache = igniteClient.cache("PersonCache");
Person person = new Person();
person.setXXX
personCache .put(person.getId(),person);


IgniteClient:

public class IgniteClient {
    private final static Logger logger = LoggerFactory
            .getLogger(IgniteClient.class);

    private static Ignite client = null;

    static {
        logger.info("Initialize Ignite Client");
        try {

            // start client ignite
            IgniteConfiguration config = new IgniteConfiguration();

//            config.setClientMode(true);
            // config.setGridName(CLIENT_GRID);
            config.setPeerClassLoadingEnabled(true);

            // Configure discovery SPI.
            TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
            TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();


ipFinder.setAddresses(Arrays.asList("192.168.100.105:47500..47509"));

            discoSpi.setIpFinder(ipFinder);

            config.setDiscoverySpi(discoSpi);

            client = Ignition.start(config);

        } catch (IgniteException e) {
            e.printStackTrace();
        }

    }

    public static Ignite getClient() {
        return client;
    }

}

thanks.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/