I am not an expert in SQL extension. I will try to answer a few questions
to the best of my knowledge.

[[
If I use the default connection pool in one XSLT page, is that
same pool used in all XSLT pages that specify the same connection
information?
]]
Yes.

[[Does the pool only exist for the duration of a single
transformation?]]
A pool is alive across multiple transformations.

>> Must I explicitly close the connection?
I guess it is not explicitly closed. You need to call
sql:setFeature($connection, 'default-pool-enabled', 'false') to close the
connection.

Regards,

Morris Kwan
XSLT Development
IBM Toronto Lab
Tel: (905)413-3729
Email: [EMAIL PROTECTED]



                                                                           
             Eric Everman                                                  
             <[EMAIL PROTECTED]                                             
             esign.com>                                                 To 
                                       [EMAIL PROTECTED]        
             02/28/2005 12:39                                           cc 
             PM                                                            
                                                                   Subject 
                                       SQL Extension Default Connection    
                                       Pool - Correct Usag                 
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi-

I'm wondering what the usage and 'scope' of the default connection pool
is.  If I use the default connection pool in one XSLT page, is that
same pool used in all XSLT pages that specify the same connection
information?  Does the pool only exist for the duration of a single
transformation?  Must I explicitly close the connection?  Will the pool
handle a db restart?

This is the XSLT chunk I use in my pages.  It works, but am I taking
advantage of the pool, especially if this code is used in multiple
pages?

================================================================
<xsl:template name="a-template">
             <xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
             <xsl:param
name="datasource">jdbc:oracle:thin:name/[EMAIL PROTECTED]:1521:db</xsl:param>
             <xsl:param name="queryString">SELECT * FROM
MY_TABLE</xsl:param>

             <xsl:variable name="connection" select="sql:new()"/>

             <xsl:value-of select="sql:setFeature($connection,
'default-pool-enabled', 'true')"/> <!-- Connection Pool -->

             <xsl:if test="not(sql:connect($connection, $driver,
$datasource))">
                         <xsl:message>Error Connecting to the
Database</xsl:message>
                         <xsl:copy-of
select="sql:getError($connection)/ext-error"/>
             </xsl:if>

             <xsl:variable name="table" select='sql:query($connection,
$queryString)'/>

             <xsl:apply-templates select="$table/sql/row-set"
mode="series-list"/>
</xsl:template>
================================================================


I've looked thru the docs and samples but have found not any explicit
help on this.

Thanks in advance,
Eric Everman



Reply via email to