15

I'm new to Oracle Coherence, and I'm trying to find a development / debug tool to help me validate my application.

It feels like there should be a straight-forward way of viewing the keys and/or values of a cache (and possibly even run ad-hoc queries and functions?). However I can't find anything except (Oracle Coherence Cache Viewer)[http://www.sl.com/products/coherenceviewer.shtml].

Otherwise I can write something to interrogate the Coherence JMX MBean, use the Coherence command-line interface, or write code myself to query my cache, but this feels like a problem which has been encountered before - hopefully I can recycle something rather than write from scratch?

Barn
  • 946
  • 12
  • 16

4 Answers4

9

The best tool I can find is the QueryPlus command-line tool shipped with a full Coherence install %COHERENCE_HOME%\bin\query.cmd or $COHERENCE_HOME/bin/query.sh.

You need to point it to your Coherence config files by setting properties on the JVM:

java -Dtangosol.coherence.cacheconfig=META-INF/wlevs/coherence/coherence-cache-config.xml -Dtangosol.pof.config=my-pof-config.xml ...

You also need to add all jars required to load your user types to the classpath, and get a tangosol-coherence-override.xml in the classpath to define the cluster to join to.

Barn
  • 946
  • 12
  • 16
3

GUI for QueryPlus: http://code.google.com/p/zh-coherence-viewer/ It can execute CohQL script and show it in table or text pane.

  • 3
    Hi Vitaliy - I've taken a look but it needs a little more documentation about how to connect it to a cluster before I can get it working.I guess it connects as a client over Extend, so why does it ask for JMX credentials? – Barn Sep 18 '12 at 09:40
2

I've been working on a command line tool based on the Coherence C++ client library here:

https://github.com/actsasflinn/coherence-tool

No CohQL yet but supports the following usage which covers most everything I'd want:

./run.sh <cache-name> get <key1> [key2] ...
./run.sh <cache-name> mget
./run.sh <cache-name> put <key> <value>
./run.sh <cache-name> mput <key1> <value1> [<key2> <value2>] ...
./run.sh <cache-name> delete <key> [key2] ...
./run.sh <cache-name> size
./run.sh <cache-name> keys
./run.sh <cache-name> values
./run.sh <cache-name> key_exists <key>
./run.sh <cache-name> value_exists <value>
./run.sh <cache-name> clear
Flynn
  • 61
  • 1
2

See also "Using Coherence Query Language": http://docs.oracle.com/cd/E15357_01/coh.360/e15723/api_cq.htm

cpurdy
  • 1,177
  • 5
  • 12