ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chevy <chetan.v.ya...@target.com>
Subject Re: [EXTERNAL] Re: Exception while trying to access cache via JDBC API
Date Thu, 03 Nov 2016 11:22:10 GMT
I am starting my server node within my boot app[1]. Both my client and server
nodes start from same code but I will get the service part with starts
client out of it later. How can I not start ignite server and still manage
to use same config in my external server node? (bold part below).

[1] - 	/* Initialize cache configuration */
			cacheCfg.setName("salesCache");
			cacheCfg.setCacheMode(CacheMode.REPLICATED);
			cacheCfg.setSwapEnabled(false);
			cacheCfg.setOffHeapMaxMemory(0);
			cacheCfg.setCopyOnRead(false);
		
cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
			cacheCfg.setAtomicWriteOrderMode(CacheAtomicWriteOrderMode.CLOCK);
			cacheCfg.setIndexedTypes(Integer.class, SalesModel.class);

			/* Start Ignite node. */
			*Ignite ignite = Ignition.start("src/main/resources/mpm-ignite.xml");*

			try (IgniteCache<Integer, SalesModel> cache =
ignite.getOrCreateCache(cacheCfg)) {
				if (ignite.cluster().forDataNodes(cache.getName()).nodes().isEmpty()) {
					System.out.println();
					System.out.println(">>> requires remote cache nodes to be started.");
					System.out.println(">>> Please start at least 1 remote cache node.");
					System.out.println();
					return;
				}

				// Put created data entries to cache.
				cache.putAll(salesFinalMap);
                        } catch (Exception e) {
				ignite.destroyCache("salesCache");
				throw e;
			} finally {
				// Delete cache with its content completely.
				// ignite.destroyCache("testCache");
			}



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Exception-while-trying-to-access-cache-via-JDBC-API-tp8648p8684.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message