John,

I'm back at it. What is the XSL to call close( SQLDocument sqldoc ), XConnection line 
1084? I need to reales just one query and it's connection, while leaving other queries 
active.

Here is a simplified version of what I need to do. I connect with:

 <xsl:variable name="DbCon" select="sql:new()"/>
 <xsl:value-of select="sql:setFeature( $DbCon, 'default-pool-enabled', 'true')"/>
 <xsl:value-of select="sql:setFeature( $DbCon, 'streaming', 'false')"/>
 <xsl:if test="not( sql:connect( $DbCon, $DbDrvr, $DbUrl, $DbUsr, $DbPwd))" >
   <xsl:copy-of select="sql:getError($DbCon)/ext-error" />
 </xsl:if>

Then I run a parent query

 <xsl:variable name="SQL">
   select Ix from List
 </xsl:variable>
 <xsl:variable name="Qy" select="sql:query( $DbCon, $SQL)"/>
 <xsl:if test="$msg-sql or not( $Qy)">
   <xsl:message terminate="no"><xsl:value-of select="$SQL"/>= <xsl:value-of 
select="$Qy/sql/row-set/row[1]/col[1]"/></xsl:message>
 </xsl:if>
 <xsl:if test="not( $Qy)" >
   <xsl:apply-templates select="sql:getError( $DbCon)/ext-error"/>
 </xsl:if>
 <xsl:for-each select="$Qy/sql/row-set/row">

Then, for each row, I run a child query like this:

 <xsl:variable name="SQL">
   select * from Table where Ix= <xsl:value-of select="col['Ix'[EMAIL PROTECTED]"/>
 </xsl:variable>
 <xsl:variable name="Qy" select="sql:query( $DbCon, $SQL)"/>
 <xsl:if test="$msg-sql or not( $Qy)">
   <xsl:message terminate="no"><xsl:value-of select="$SQL"/>= <xsl:value-of 
select="$Qy/sql/row-set/row[1]/col[1]"/></xsl:message>
 </xsl:if>
 <xsl:if test="not( $Qy)" >
   <xsl:apply-templates select="sql:getError( $DbCon)/ext-error"/>
 </xsl:if>
 <!-- return value -->
 <xsl:value-of select="$Qy/sql/row-set/row[1]/col[1]"/>

Then I want to close just the child query, because I'm still in the middle of the 
parent resultset:

 <xsl:value-of select="sql:close( $DbCon, $Qy)"/>

Gives me:

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerException): 
java.lang.NoSuchMethodException: For extension function, could not find method static 
org.apache.xalan.lib.sql.XConnection.close([ExpressionContext, ]#UNKNOWN 
(org.apache.xalan.lib.sql.XConnection), #NODESET) nor
class org.apache.xalan.lib.sql.XConnection.close([ExpressionContext,] #NODESET).

While:

 <xsl:value-of select="sql:close( $DbCon)"/>

releases both the parent and child connection and Gives me:

XSLT Error (javax.xml.transform.TransformerException): 
java.lang.ArrayIndexOutOfBoundsException: -1

because the parent connection has been closed so there is nothing there for the <xsl:for-each 
select="$Qy/sql/row-set/row"> to evaluate <xsl:value-of select="col['Ix'[EMAIL 
PROTECTED]"/>

If I comment out the <xsl:value-of select="sql:close( $DbCon)"/>

The results are correct. However, this is impractical because if I leave out ALL the 
closes I get many, many connections opened, which leads to other problems.

Any Ideas? Thanks.

Regards, Phil Friedman - Terralink Software - 1-207-772-6500 x101


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to