geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v2.1 > Using datasource pool wizard in GEP
Date Thu, 15 Apr 2010 09:02:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1520/1/1/_/styles/combined.css?spaceKey=GMOxDOC21&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="http://cwiki.apache.org/confluence/display/GMOxDOC21/Using+datasource+pool+wizard+in+GEP">Using
datasource pool wizard in GEP</a></h2>
    <h4>Page  <b>added</b> by             <a href="http://cwiki.apache.org/confluence/display/~carol%2Bh">Di
Hu</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC21/Quick+Debugging+JSPs+of+your+application"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC21/Quick+Debugging+JSPs+of+your+application">Quick
Debugging JSPs of your application</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/GMOxDOC21/Development+and+deployment+planning"><img border='0'
align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/GMOxDOC21/Development+and+deployment+planning">Development and
deployment planning</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;</td></tr></table></div>

<p>This article shows you how to create a datasource pool in GEP during development.
The datasource pool wizard is a handy feature to speed up your development by creating a datasouce
connector without any manual coding. Information of the connector you create using this wizard
is embedded in the deployment plan of the application as an <tt>&lt;ext-module&gt;</tt>
element. </p>


<p>Note that this wizard has the following 2 limitations:</p>
<ul>
	<li>It is only available when you develop a EAR project In Eclipse.</li>
	<li>It only supports the embedded Apache Derby database.</li>
</ul>


<h1><a name="UsingdatasourcepoolwizardinGEP-Addinganewdatasourcepool"></a>Adding
a new datasource pool</h1>

<p>To use the datasource pool wizard in GEP:</p>

<ol>
	<li>Double-click the <tt>geronimo-application.xml</tt> file under the <tt>/META-INF</tt>
directory of your application to open it in the <b>Geronimo Deployment Plan Editor</b>.
The following figure shows the <b>General</b> tab of the editor:
<br clear="all" /> 
<br clear="all" />   <span class="error">Unable to render embedded object: File
(GEP_Wizard.png) not found.</span><br clear="all" />
<br clear="all" /></li>
	<li>Click the <b>Connector</b> tab, and then open the <b>Database
Pools</b> section to see the datasource pools that are defined. The following figure
shows the <b>Database Pools</b> section in the <b>Connector</b> tab:
<br clear="all" /> 
<br clear="all" />   <span class="error">Unable to render embedded object: File
(GEP_DSWizard2.png) not found.</span><br clear="all" />
<br clear="all" />The following list describes the functions of the three buttons in
the <b>Database Pools</b> section:<br clear="all" />
<br clear="all" />
	<ul>
		<li><b>Add</b> - create a new datasouce pool.<br clear="all" /></li>
		<li><b>Remove</b> - remove an existing datasource connector.<br clear="all"
/></li>
		<li><b>Edit</b> - reconfigure an existing datasource connector.<br
clear="all" />
<br clear="all" /></li>
	</ul>
	</li>
	<li>Click <b>Add</b> to start a datasource pool wizard, and then fill in
the required fields. The following figure shows the database pool wizard:
<br clear="all" /> 
<br clear="all" />  <span class="error">Unable to render embedded object: File
(GEP_DSWizard3.png) not found.</span><br clear="all" />
<br clear="all" /> The following list introduces the fields in this step of the datasource
pool wizard:<br clear="all" />
<br clear="all" />
	<ul>
		<li><b>Connector:</b> specify the location of a Java EE Connector module.<br
clear="all" /></li>
		<li><b>External-path:</b> indicate that the module is not part of the
enterprise application and must be located by matching the supplied pattern in a Geronimo
repository.<br clear="all" />
<br clear="all" /></li>
	</ul>
	</li>
	<li>Click <b>Next</b> to edit <b>Basic Settings</b> and choose
a driver for the datasource pool.<br clear="all" />
<br clear="all" /> The basic settings include pool name, database type and database
name. Because this wizard only supports embedded Apache Derby database, there are only 2 available
options(xa and non-xa) in the <b>Database Type</b> drop-down list and only one
driver in the <b>Driver Details</b> field. The driver is <tt>org.apache.geronimo.configs/system-database//car</tt>.<br
clear="all" />
<br clear="all" /> The following figure shows the fields in this step:
<br clear="all" /> 
<br clear="all" />   <span class="error">Unable to render embedded object: File
(GEP_DSWizard4.png) not found.</span><br clear="all" />
<br clear="all" /></li>
	<li>Click <b>Next</b> to go to the steps of <b>Advanced Pool Settings</b>
and <b>Connection Pool Parameters</b>, and then fill in the required fields.<br
clear="all" />
<br clear="all" />The following two figures show the fields in these two steps:
<br clear="all" /> 
 <table class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><tbody><tr>
 <td class="confluenceTd" valign="top" width="30%">
<p>  <span class="error">Unable to render embedded object: File (GEP_DSWizard5.png)
not found.</span> </p>
</td> 
 <td class="confluenceTd" valign="top" width="30%">
<p>   <span class="error">Unable to render embedded object: File (GEP_DSWizard6.png)
not found.</span></p>
</td>
</tr></tbody></table>
<p><br clear="all" /></p></li>
	<li>Click <b>Finish</b> to create the new datasource pool. The following
figure shows the <b>Connector</b> tab with the new datasource pool that is created
successfully:<br clear="all" />
<br clear="all" />   <span class="error">Unable to render embedded object: File
(GEP_DSWizard7.png) not found.</span><br clear="all" />
<br clear="all" /></li>
	<li>In the toolbar, click <b>Save</b> to save the settings of the new datasource
pool.</li>
</ol>


<p>Now you have created a new datasource pool. You can click the <b>Source</b>
tab to review the deployment plan of the connector. The following figure shows a sample deployment
plan with a new datasource connector embedded:<br clear="all" /></p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>geronimo-application.xml</b></div><div
class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: default; brush: xml; gutter:
false"><![CDATA[
&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;app:application application-name="TestEAR"
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" 
xmlns:client="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0" xmlns:conn="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2"

xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2"

xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0" xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"

xmlns:pers="http://java.sun.com/xml/ns/persistence" xmlns:pkgen="http://openejb.apache.org/xml/ns/pkgen-2.1"

xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"&gt;
    &lt;dep:environment&gt;
        &lt;dep:moduleId&gt;
            &lt;dep:groupId&gt;default&lt;/dep:groupId&gt;
            &lt;dep:artifactId&gt;TestEAR&lt;/dep:artifactId&gt;
            &lt;dep:version&gt;1.0&lt;/dep:version&gt;
            &lt;dep:type&gt;car&lt;/dep:type&gt;
        &lt;/dep:moduleId&gt;
        &lt;dep:dependencies&gt;
            &lt;dep:dependency&gt;
                &lt;dep:groupId&gt;org.apache.geronimo.configs&lt;/dep:groupId&gt;
                &lt;dep:artifactId&gt;system-database&lt;/dep:artifactId&gt;
                &lt;dep:type&gt;car&lt;/dep:type&gt;
            &lt;/dep:dependency&gt;
            &lt;dep:dependency&gt;
                &lt;dep:groupId&gt;org.apache.geronimo.framework&lt;/dep:groupId&gt;
                &lt;dep:artifactId&gt;j2ee-security&lt;/dep:artifactId&gt;
                &lt;dep:type&gt;car&lt;/dep:type&gt;
            &lt;/dep:dependency&gt;
        &lt;/dep:dependencies&gt;
    &lt;/dep:environment&gt;
    &lt;app:ext-module&gt;
        &lt;app:connector&gt;TestDataSource&lt;/app:connector&gt;
        &lt;app:external-path&gt;
            &lt;dep:groupId&gt;org.tranql&lt;/dep:groupId&gt;
            &lt;dep:artifactId&gt;tranql-connector-derby-embed-xa&lt;/dep:artifactId&gt;
            &lt;dep:type&gt;rar&lt;/dep:type&gt;
        &lt;/app:external-path&gt;
        &lt;conn:connector&gt;
            &lt;conn:resourceadapter&gt;
                &lt;conn:outbound-resourceadapter&gt;
                    &lt;conn:connection-definition&gt;
                        &lt;conn:connectionfactory-interface&gt;javax.sql.DataSource&lt;/conn:connectionfactory-interface&gt;
                        &lt;conn:connectiondefinition-instance&gt;
                            &lt;conn:name&gt;jdbc/TestDataSource&lt;/conn:name&gt;
                            &lt;conn:config-property-setting name="Password"&gt;manager&lt;/conn:config-property-setting&gt;
                            &lt;conn:config-property-setting name="LoginTimeout"&gt;5000&lt;/conn:config-property-setting&gt;
                            &lt;conn:config-property-setting name="DatabaseName"&gt;TestDataBase&lt;/conn:config-property-setting&gt;
                            &lt;conn:config-property-setting name="CreateDatabase"&gt;true&lt;/conn:config-property-setting&gt;
                            &lt;conn:config-property-setting name="UserName"&gt;system&lt;/conn:config-property-setting&gt;
                            &lt;conn:connectionmanager&gt;
                                &lt;conn:xa-transaction&gt;
                                    &lt;conn:transaction-caching/&gt;
                                &lt;/conn:xa-transaction&gt;
                                &lt;conn:single-pool&gt;
                                    &lt;conn:max-size&gt;10&lt;/conn:max-size&gt;
                                    &lt;conn:min-size&gt;0&lt;/conn:min-size&gt;
                                    &lt;conn:blocking-timeout-milliseconds&gt;5000&lt;/conn:blocking-timeout-milliseconds&gt;
                                    &lt;conn:idle-timeout-minutes&gt;30&lt;/conn:idle-timeout-minutes&gt;
                                    &lt;conn:match-one/&gt;
                                &lt;/conn:single-pool&gt;
                            &lt;/conn:connectionmanager&gt;
                        &lt;/conn:connectiondefinition-instance&gt;
                    &lt;/conn:connection-definition&gt;
                &lt;/conn:outbound-resourceadapter&gt;
            &lt;/conn:resourceadapter&gt;
        &lt;/conn:connector&gt;
    &lt;/app:ext-module&gt;
 &lt;/app:application&gt;
]]></script>
</div></div>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC21/Using+datasource+pool+wizard+in+GEP">View
Online</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/GMOxDOC21/Using+datasource+pool+wizard+in+GEP?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message