Configure Run Sample Coherence Cache Client Application

Configure Run Sample Coherence Cache Client Application

In previous tutorial you saw:

Today you will see how to run coherence cache client application.

  • To run cache client applcation make sure cache server is started using How to test Coherence Installation tutorial
  • Set java system java path if you are not sure how to set java path please follow this tutorial
  • cd to C:\Oracle\Middleware\Oracle_Home\coherence\bin
  • open query.cmd file and add COHERENCE_HOME path based on your cache install location

  • Execute query.cmd as below:

Configure Run Sample Coherence Cache Client Application

  • You will see below output with CohQL> prompt displayed:

Configure Run Sample Coherence Cache Client Application

Now start exercise with sample cache client application using below command:

  • create cache “products”
  • insert into “products” key “television” value “ID-5070”
  • update “products” set value() = “ID-5080” where key() like “television”
  • select * from “products”
  • select key(), value() from “products” where key() is “radio”
  • delete from “products” where key() = “television”
  • delete from “products”
  • drop cache “products”
  • create cache “products”
  • insert into “products” key “television” value “ID-5080”
  • insert into “products” key “radio” value “ID-5090”
  • insert into “products” key “MP3 Player” value “ID-5100”
  • insert into “products” key “laptop” value “ID-5110”
  • select key(), value() from “products”
  • backup cache “products” to “products.bkup”
  • delete from “products” where key() = “television”
  • select key(), value() from “products”
  • delete from “products”
  • select * from “products”
  • restore cache “products” from file “products.bkup”
  • select key(), value() from “products”
  • drop cache “products”

Exit the command-line tool:

  • bye

Sample commands:

Configure Run Sample Coherence Cache Client Application

  • For more information please visit this oracle official tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *