9 Replies Latest reply: Aug 29, 2011 2:39 AM by 765031 RSS

    Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.

    765031
      Hi,

      I am new to Oracle Coherence. I was looking for examples implementing Oracle Coherence step by step so as to get a basic understanding using JDeveloper but most of the examples available are using Oracle Service Bus and Eclipse.

      Could anyone please help me in providing link with examples using Oracle Coherence with Oracle SOA suite 11.1.1.4.0 and JDeveloper.

      Thanks for the needful.

      Cheers,
      Varun
        • 1. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
          723376
          Hi Varun,

          I hope the Oracle® Coherence Tutorial for Oracle Coherence Release 3.6 helps:

          http://download.oracle.com/docs/cd/E15357_01/coh.360/e15831/installjdev.htm

          -Luk
          • 2. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
            User738616-Oracle
            Hi Varun,

            There are tones of material available on how to use JDeveloper for Coherence http://download.oracle.com/docs/cd/E13924_01/coh.340/e14135/installjdev.htm.

            Re the SOA Suite and Coherence, there is no Coherence activity or direct integration available. The only way you can use Coherence from with within SOA suite is either using Java Embedded Activity (http://ora-soa.blogspot.com/2011/06/accessing-custom-java-code-in-bpel-eg.html) or wrap the Coherence Java Code using APIs as a Web Service and call them using WS or Direct Binding. In order to make some simple Coherence examples refer to the Coherence Developers' Guide.

            Hope this helps!

            Cheers,
            NJ
            • 3. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
              765031
              Hi Luk / NJ,

              I have created a simple java web application and I'm trying to use that web service for inserting and fetching the data into Coherence Cache Server.. When i invoke the web service interface, I am able to retrieve get the data that has been inerted by my application. But the same data is not available if I used start Coherence Node to see tha cache map i'm using. The same is happening for the vice versa scenario.

              Now the questions that I have are:
              1) How do I integrate the NamedCache Object that I am making in my application and the Cache Server that is installed on Server?
              2) If a web service has to fetch data from a shared cache what is the procedure?
              3) Is there any other approach through which i can achieve what i m trying to?
              4) Any tutorials for Coherence in BPEL service?
              • 4. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
                User738616-Oracle
                Hi Varun,

                AFAIK there are only 2 ways to integrate BPEL and Coherence - WS and Java Activity. Now re your use case, the probable reason for the problem is that the cluster used by your web application is not the same that your are using for starting the Coherence node. If you will carefully look at the logs, there is a multicast/unicast details of the cluster published before the cluster is started. Also you can always pass the system property using the -Dtangosol.coherence.override property and you can find a sample file in coherence.jar.

                1) How do I integrate the NamedCache Object that I am making in my application and the Cache Server that is installed on Server?
                You need to make sure that the configuration "tangosol-coherence-override" defining the cluster configuration used by your application and Cache server is identical and also the coherence-cache configuration is identical.

                2) If a web service has to fetch data from a shared cache what is the procedure?
                NamedCache namedCache = CacheFactory.getCache(<cache_name>)
                namedCache.get (<Key>)


                3) Is there any other approach through which i can achieve what i m trying to?
                Yes it is very much possible ....

                4) Any tutorials for Coherence in BPEL service?
                No that I am aware about .. look in the forums for some issues that people are facing in integrating them ..

                Cheers,
                NJ
                • 5. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
                  765031
                  Hi NJ,

                  Thanks a lot for reply.

                  I am sure that your knowledge is pretty correct wrt the ways to integrate BPEL and Coherence i.e. by Web Service and Java Activity. But I'm still unclear with some of the concepts.

                  1) Could you please let me know how to use this system property -Dtangosol.coherence.override in my application so that I can coordinate between the cluster used by my application and the one started for using Coherence Node.

                  2) I was trying to understand how to use this tangosol-coherence-override.xml but the document is pretty confusing. I am not able to understand that whether I am suppose to use it at server level or at application level.

                  3) Another point is how to coordinate among tangosol-coherence-override.xml, coherence-cache-config.xml and -Dtangosol.coherence.override system property from my application

                  4) How to use the cache updating mechanisms from an application?

                  Thanks a lot for your help.

                  Cheers,
                  Varun
                  • 6. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
                    User738616-Oracle
                    Hi Varun,

                    Please find the answers to your questions below:

                    1) Could you please let me know how to use this system property -Dtangosol.coherence.override in my application so that I can coordinate between the cluster used by my application and the one started for using Coherence Node.
                    You need to specify this property in the Java Options of your server or cache node startup script.

                    2) I was trying to understand how to use this tangosol-coherence-override.xml but the document is pretty confusing. I am not able to understand that whether I am suppose to use it at server level or at application level.
                    I would suggest extract the coherence.jar and you it would be important for you to have a look at the tangosol-coherence.xml and tangosol-coherence-override.xml. This file is used to override any of the properties specified in tangosol-coherence.xml for your cluster configuration for example, clustername, multicast ip and port or WKA for unicast, logging and so on.

                    3) Another point is how to coordinate among tangosol-coherence-override.xml, coherence-cache-config.xml and -Dtangosol.coherence.override system property from my application
                    Ideally you should specify in the java options of your application startup but you can also sepcify using System.setProperty("property", "value") in you code for specifying the various properties

                    4) How to use the cache updating mechanisms from an application?
                    I am not clear what do you mean by cache updating mechanisms? If you mean how you can update the cache from application then you can use simple Put, Entry Processor and so on. Refer NamedCache APIs to start with for operations but there many other ways to update the cache from within application or otherwise

                    Hope this helps!

                    Cheers,
                    NJ
                    • 7. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
                      765031
                      Hi NJ

                      Thanks a lot for reply. Your inputs have been of real great help. Everytime you reply my knowledge regarding Coherence keeps getting better.

                      Regarding the question on How to use the cache updating mechanisms from an application?
                      My requirement is something like this. I want to implement Coherence so as to reduce database i/o operations from my application which is trying to look up some configuration tables. The table is refreshed every 4 hours. The estimated number of database i/o operations is 10 per sec. So we are planning to implement Coherence so as to improve performance and minimise database i/o operations.
                      Also the cache needs to be updated using either Write through or write behind or any other mechanisms so as to be in sync with database. How can I achieve this requirement using Coherence.

                      Another question that I have is while doing Coherence tutorial and making java application, we are passing -Dtangosol.coherence.cache.config=<path>/coherence-cache-config.xml in run/debug profile. how do we pass these parameters when we are running this java application as a web service.

                      Thanks for the needful.

                      Cheers,
                      Varun
                      • 8. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
                        User738616-Oracle
                        Hi Varun,

                        The cache cannot be updated from the database using the write-through/behind strategy as these strategy are used for updating the database from the cache and not the reverse. The write-through/behind are used when you would like to use coherence as a stage between DB and the client. Now depending on how criticial is to have the real time data in the Coherence cache, you might use:

                        1. Database Trigger (Java pgm) to clean the entire cache on update [Cache in sync with database]. The cache store will load the entries from the datbase as they are requested.

                        2. Set expiry time for your cache in the cache configuration or mention the expiry time for entries using put API [Corner cases where all the entries will not be in sync with database]

                        Your web service will run on standalone or on any application server and you can specify the java system properties in the script that starts the application or standalone server as you have done in your run/debug profile. Try google to search "How to set system properties in Java"??

                        In future, you need to mark this thread as answered and open another thread for questions that does not match the post title for everyone's benefit.

                        Cheers,
                        NJ
                        • 9. Re: Oracle Coherence Examples with Oracle SOA suite 11.1.1.4.0 and JDeveloper.
                          765031
                          Hi NJ

                          Thanks a lot for reply. I was caught up with something else and hence couldn't reply. Thanks for all your inputs. These inputs have been of real great help.

                          I completely agree with you. I'll surely mark this thread as answered and open a new thread with the question about the requirement I have.

                          Cheers,
                          Varun