Hi,
We are using Ignite cache version 2.1 . We are using it as persistent store
in Partitioned Mode having 6 data node running. Atomicity mode is
ATOMIC, and Rebalance mode is ASYNC while CacheWriteSynchronizationMode is
FULL_SYNC.
We have ignite client which does read/write to ignite data grid.
In certain scenario, we might have to restart data grid, in that case client
connection to datagrid becomes stale.
Is there a way at client (apart from IllegalStateException ) to know that
its no longer part of cluster and has to restablish connection to data grid
?
Following is the code which is being used to connect to data grid:
Ignition.setClientMode(true);
Ignite ignite = Ignition.start("etc/config/" + fileName);
ignite.active(true);
We use *ignite* instance above to read and write to grid. But when client
becomes stale (in case of datagrid restart) we get following exception at
client end :
Caused by: java.lang.IllegalStateException: Grid is in invalid state to
perform this operation. It either not started yet or has already being or
have stopped [igniteInstanceName=8cd92f6f-8b7a-45ae-8c2f-9386
83e67a40, state=STOPPED]
at
org.apache.ignite.internal.GridKernalGatewayImpl.illegalState(GridKernalGatewayImpl.java:201)
at
org.apache.ignite.internal.GridKernalGatewayImpl.readLock(GridKernalGatewayImpl.java:95)
at
org.apache.ignite.internal.IgniteKernal.guard(IgniteKernal.java:3693)
at
org.apache.ignite.internal.IgniteKernal.cache(IgniteKernal.java:2729)
at com..datagrid.DataGridClient.cache(DataGridClient.java:277)
at
com..datagrid.DataGridClient.readFromGrid(DataGridClient.java:160)
Please note that we are using Ignite 2.1 version and will soon upgrade to
Ignite 2.3.
Thanks,
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/