I am facing an issue with maintaining continuity with my H2 db in cluster 
mode.

These are the steps i performed to get the cluster setup and be able to 
write to it with the webapp.

On System 1 (192.168.1.2). Activate the h2 server
java -cp h2-1.3.171.jar org.h2.tools.Server -tcp -tcpPort 9100 -baseDir 
~/data -tcpAllowOthers &

On System 3 (192.168.1.3). Activate the h2 server
java -cp h2-1.3.171.jar org.h2.tools.Server -tcp -tcpPort 9100 -baseDir 
~/data -tcpAllowOthers &

Now, cluster the DBs
java -cp lib/h2-1.3.171.jar org.h2.tools.CreateCluster -urlSource 
jdbc:h2:tcp://192.168.1.2:9100/dbname -urlTarget 
jdbc:h2:tcp://192.168.1.3:9100/dbname -user dbname -serverList 
192.168.1.2:9100,192.168.1.3:9100

I set the Log Level to 4 and set the file trace to level 3 to help with the 
debugging.
So, with both the DB in cluster mode, and connected to the net, i see an 
entry in the trace logs as

/*SQL */SET CLUSTER '192.168.1.62:9100,192.168.1.61:9100';
09-29 12:27:55 jdbc[3]:
/*SQL #:1*/CALL DATABASE();
09-29 12:27:55 jdbc[3]:
/*SQL */COMMIT;
09-29 12:27:55 jdbc[3]:
/*SQL */ROLLBACK;
09-29 12:27:55 database: disconnecting session #3
09-29 12:27:55 database: disconnected session #3
09-29 12:27:58 database: connecting session #4 to dbname
09-29 12:27:58 jdbc[4]:
/*SQL */SET AUTO_RECONNECT TRUE;
09-29 12:27:58 jdbc[4]:
/*SQL */SET LOG 4;
09-29 12:27:58 jdbc[4]:
/*SQL */SET CLUSTER TRUE;
09-29 12:27:58 jdbc[4]:
/*SQL */SET AUTOCOMMIT ON;
09-29 12:27:58 jdbc[4]:
/*SQL */SET MVCC TRUE;
09-29 12:27:58 jdbc[4]:
/*SQL */SET TRACE_LEVEL_FILE 3;
09-29 12:27:58 jdbc[4]:

Now, when i simulate the disconnection of one of the databases, the trace 
file logs show an entry like this
/*SQL */SET CLUSTER '';
09-29 12:44:37 jdbc[308]:
09-29 12:44:37 jdbc[308]:
/*SQL #:1*/CALL DATABASE();
09-29 12:44:37 jdbc[308]:
/*SQL */COMMIT;
09-29 12:44:37 jdbc[308]:
/*SQL */ROLLBACK;
09-29 12:44:37 database: disconnecting session #308
09-29 12:44:37 database: disconnected session #308
09-29 12:49:36 database: connecting session #309 to dbname
09-29 12:49:36 jdbc[309]:
/*SQL */SET AUTO_RECONNECT TRUE;
09-29 12:49:36 jdbc[309]:
/*SQL */SET LOG 4;
09-29 12:49:36 jdbc[309]:
/*SQL */SET CLUSTER TRUE;

Its at the above step that the db is very very hard to read by the 
webapplication. affecting the purpose of the database.

Can you let me know what maybe the cause for this issue, and how can that 
be mitigated, if it is possible?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to