Book Image

Oracle Coherence 3.5

By : Aleksandar Seovic
Book Image

Oracle Coherence 3.5

By: Aleksandar Seovic

Overview of this book

Scalability, performance, and reliability have to be designed into an application from the very beginning, as there may be substantial cost or implementation consequences if they need to be added down the line. This indispensible book will teach you how to achieve these things using Oracle Coherence, a leading data grid product on the market.Authored by leading Oracle Coherence authorities, this essential book will teach you how to use Oracle Coherence to build high-performance applications that scale to hundreds of machines and have no single points of failure. You will learn when and how to use Coherence features such as distributed caching, parallel processing, and real-time events within your application, and understand how Coherence fits into the overall application architecture. Oracle Coherence provides a solid architectural foundation for scalable, high-performance and highly available enterprise applications, through features such as distributed caching, parallel processing, distributed queries and aggregations, real-time events, and the elimination of single points of failure.However, in order to take full advantage of these features, you need to design your application for Coherence from the beginning. Based on the authors' extensive knowledge of Oracle Coherence, and how to use it in the real world, this book will provide you with all the information you need in order to leverage various Coherence features properly. It contains a collection of best practice-based solutions and mini-frameworks that will allow you to be more productive from the very beginning.The early chapters cover basics like installation guidelines and caching topologies, before moving on to the domain model implementation guidelines, distributed queries and aggregations, parallel processing, and real-time events. Towards the end, you learn how to integrate Coherence with different persistence technologies, how to access Coherence from platforms other than Java, and how to test and debug classes and applications that depend on Coherence.
Table of Contents (22 chapters)
Oracle Coherence 3.5
Credits
Foreword
About the author
Acknowledgements
About the co-authors
About the reviewers
Preface
12
The Right Tool for the Job
Index

Deploying the Java Application


In order to deploy the Java application, you need to perform several steps:

  1. Open a command prompt and navigate to the CoherentBank\java directory.

  2. Edit build.properties file to reflect your environment.

  3. Start the H2 database:

    > ant start-db-server
    

    If everything goes well, the H2 console should open in the browser. You can log in by changing the JDBC URL to jdbc:h2:tcp://localhost/db/coherent-bank-db, setting the username to sa, and clicking the Connect button.

    There will be no tables there at first, which will be corrected shortly.

  4. Start the web application:

    > ant web-app
    

    This should run the SQL script to create necessary tables, build the application, start the embedded Jetty web server, and open up the web browser showing the login screen.

    If the web server fails to start make sure that you don't have anything else running on port 8080 and retry (or alternatively, change the jetty.port property within the build.xml file).

    If the browser does not open automatically, make sure that you have specified the correct browser location in the build.properties file, or open the browser manually and navigate to http://localhost:8080/bank/login.

  5. Log in using one of the test users from the following table, or create an account for yourself by clicking on the register here link below the login form.

    The test accounts that are set up by default are:

    Username

    Password

    sele

    pass

    aca

    pass

    marko

    pass

    ivan

    pass

    mark

    pass

    patrick

    pass

  6. Play with the application—post some transactions by paying bills, look at the transaction list, edit a user profile, and so on.

  7. Start the Coherence Extend proxy server:

    > ant start-extend-proxy
    

    This will allow C++ and .NET clients to connect to the cluster.

    Tip

    Optional: Run independent cache servers

    By default, the web application runs as a storage-enabled Coherence node to simplify deployment, even though that is not how you would run it in production.

    If you want to simulate a more realistic environment, uncomment the -Dtangosol.coherence.distributed.localstorage=false JVM argument within start-web-server target in build.xml.

    However, if you do this you will need to run one or more cache servers before Step 4. You can do that by changing the startup sequence to:

    > ant start-db-server
    > ant start-cache-server (one or more times)
    
    > ant web-app
    > ant start-extend-proxy