<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Jboss 6.0 + PostgreSQL Datasource + security-domain + CallerIdentityLoginModule : Can i set max number of pools?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/panixgr">achill mantzios</a> in <i>IronJacamar</i> - <a href="http://community.jboss.org/message/578289#578289">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><div class="jive-rendered-content"><p>Hello and merry Xmas to all.<br/>Being a jboss user (starting from 3.0.3, still deployed in some remote locations) for the the last 10 years,<br/>I have succesfully set up a new test system Jboss 6.0, postgresql 9.0.2, openjdk 1.6, in a process to completely<br/>upgrade all of our application engine software.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I had an idea, instead of going the old way of creating the postgresql pool with one user (typically : postgres),<br/>to try having personalized connections, which makes debugging, diagnosing a very very easy task.<br/>So i set up &lt;security-domain&gt;postgresqluser&lt;/security-domain&gt;, then in login-config.xml i defined <br/>&lt;application-policy name="postgresqluser"&gt;<br/>&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;login-module code="org.jboss.resource.security.CallerIdentityLoginModule" flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name = "managedConnectionFactoryName"&gt;jboss.jca:service=XATxCM,name=pgsql&lt;/module-option&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160; &lt;/application-policy&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I set up both jboss and postgresql authenticate against the same LDAP server, and all the magic seemed to work!!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>As i understand it, one separate pool will be created for each user.<br/>However this is the only unpleasant thing in the whole story.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'd like to have a way to restrict the max total pools created, in order to pose a limit in the max total connections to the db.<br/>In other words emulate &lt;max-pool-size&gt; as if we were talking about the normal "OnePool" case.<br/>Is there anything to pose a limit to the number of actual pools created?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is not for use in high traffic web situation (where usually the apps are simple and the number of users large).<br/>This is for a business, with 200 total users, but a big complexity of apps, queries, etc...<br/>I am planning to set up min-pool-size=0, max-pool-size=4 and idle-timeout-minutes=5 minutes.<br/>(maybe more fine tuning on this last one)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>During the last 10 months, we had on average 100 distinct logged in users par day, and 130 max.<br/>Haven't done yet any research on the definition/estimation of "concurrent" users in the system.<br/>(in order to assess the max number of "simultaneous" connections).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Anyway, I'd like to ask :<br/>a) if you see any potential risks with this<br/>b)&#160; if there is a way to limit the max numbers of pools (as a means to&#160; limit the max total potential number of connections to the db)<br/>c) My eye fell on <a class="jive-link-external-small" href="http://docs.jboss.org/jbossas/6/JCA_Guide/en-US/html_single/#An_Overview_of_the_JBoss_JCA_Architecture-JBossManagedConnectionPool_MBean" target="_blank">http://docs.jboss.org/jbossas/6/JCA_Guide/en-US/html_single/#An_Overview_of_the_JBoss_JCA_Architecture-JBossManagedConnectionPool_MBean</a><br/>where it suggest that by specifying Criteria=ByNothing means <br/>"all connections are equivalent, usually if adapter supports reauthentication "</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Ideally what would be great is if we could have a total max number of connections, across all users, <br/>and reauthenticating in the already existing connections.<br/>I dont know whether postgresql supports this but it would be cool in general to have.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank you for any help!</p></div></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/578289#578289">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in IronJacamar at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>