You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2010/12/26 11:47:10 UTC

svn commit: r1052864 - in /synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide: samples.xml samples/sample362.xml samples/sample363.xml

Author: hiranya
Date: Sun Dec 26 10:47:10 2010
New Revision: 1052864

URL: http://svn.apache.org/viewvc?rev=1052864&view=rev
Log:
more DB samples

Modified:
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample362.xml
    synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample363.xml

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml?rev=1052864&r1=1052863&r2=1052864&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples.xml Sun Dec 26 10:47:10 2010
@@ -143,8 +143,8 @@
                     <ul>
                         <li><a href="samples/sample360.html">Sample 360: Introduction to dblookup mediator</a></li>
                         <li><a href="samples/sample361.html">Sample 361: Introduction to dbreport mediator</a></li>
-                        <li><a href="#Sample362">Sample 362: Action of dbreport and dblookup mediators together</a></li>
-                        <li><a href="#Sample363">Sample 363: Reusable database connection pools</a></li>
+                        <li><a href="samples/sample362.html">Sample 362: Perform database lookups and updates in the same mediation sequence</a></li>
+                        <li><a href="samples/sample363.html">Sample 363: Reusable database connection pools</a></li>
                         <li><a href="#Sample364">Sample 364: Executing database Stored Procedures</a></li>
                     </ul>
                 </p>

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample362.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample362.xml?rev=1052864&r1=1052863&r2=1052864&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample362.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample362.xml Sun Dec 26 10:47:10 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 362</title>
     </properties>
     <body>
-        <section name="Sample 362: ">
+        <section name="Sample 362: Perform Database Lookups and Updates in the Same Mediation Sequence">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;sequence name="main"&gt;
@@ -90,13 +90,19 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    <a href="sample360.html">Sample 360</a> and <a href="sample361.html">sample 361</a>
+                    shows how to use the dblookup mediator and dbreport mediator separately. This sample
+                    combines them in a single mediation sequence to perform both database lookup and
+                    update operations.
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
                 <p>
                     <ul>
                         <li>
+                            Setup a Derby database as described in the database setup guide
+                        </li>
+                        <li>
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
@@ -110,11 +116,26 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    In this sample, the dbreport mediator works the same way as in
+                    <a href="sample361.html">sample 361</a>. It updates the price for the given company
+                    using the response messages content. Then the dblookup mediator reads the last
+                    updated value from the company database and logs it to the console.
+                </p>
+                <p>
+                    Run the sample client as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+                <p>
+                    Synapse will update the database using the stock quote value available in the
+                    response sent by Axis2. Then the same value will be retrieved from the database
+                    and logged as follows.
+                </p>
+                <div class="consoleOutput">INFO LogMediator text = ** Reporting to the Database **
+...
+INFO LogMediator text = ** Looking up from the Database **
+...
+INFO LogMediator text = Stock price - 153.47886496064808</div>                
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>        

Modified: synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample363.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample363.xml?rev=1052864&r1=1052863&r2=1052864&view=diff
==============================================================================
--- synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample363.xml (original)
+++ synapse/trunk/scratch/hiranya/website/src/site/xdoc/userguide/samples/sample363.xml Sun Dec 26 10:47:10 2010
@@ -23,7 +23,7 @@
         <title>Apache Synapse - Sample 363</title>
     </properties>
     <body>
-        <section name="Sample 363: ">
+        <section name="Sample 363: Reusable Database Connection Pools">
             <div class="xmlConf">&lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
 
     &lt;sequence name="myFaultHandler"&gt;
@@ -154,13 +154,18 @@
 &lt;/definitions&gt;</div>
             <subsection name="Objective">
                 <p>
-
+                    Demonstrate how to setup reusable connection pools for the dblookup and dbreport
+                    mediators
                 </p>
             </subsection>
             <subsection name="Pre-requisites">
                 <p>
                     <ul>
                         <li>
+                            Setup a Derby database and the Synapse data sources as described in the
+                            database setup guide
+                        </li>
+                        <li>
                             Deploy the SimpleStockQuoteService in the sample Axis2 server and start Axis2
                         </li>
                         <li>
@@ -174,11 +179,25 @@
                 </p>
             </subsection>
             <subsection name="Executing the Client">
-                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/</div>
-
-                <div class="consoleOutput">Sat Nov 18 21:01:23 IST 2006 SimpleStockQuoteService :: Generating quote for : IBM</div>
-
-                <div class="consoleOutput">Standard :: Stock price = $95.26454380258552</div>
+                <p>
+                    This sample employs two instances of the dblookup mediator and a single instance
+                    of the dbreport mediator. The two dblookup mediators are sharing the same database
+                    connection pool named 'lookupdb'. The dbreport mediator makes use of a different
+                    connection pool named 'dbreport'. Synapse uses Apache DBCP to create and manage
+                    the corresponding data sources and connection pools.
+                </p>
+                <p>
+                    Run this sample by invoking the client as follows.
+                </p>
+                <div class="command">ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dsymbol=IBM</div>
+                <p>
+                    Synapse will log the following output as it reads from and writes to the database.
+                </p>
+                <div class="consoleOutput">INFO LogMediator text = ** Looking up from the Database ** ...
+INFO LogMediator text = Company ID - c1 ...
+INFO LogMediator text = ** Reporting to the Database ** ...
+INFO LogMediator text = ** Looking up from the Database ** ...
+INFO LogMediator text = Stock price - 183.3635460215262</div>
             </subsection>
         </section>
         <p><a href="../samples.html">Back to Catalog</a></p>