tcurdt 02/02/20 03:31:28
Modified: src/java/org/apache/cocoon/components/language/markup/xsp/java
esql.xsl
Log:
fixed bug #4932 submitted by [EMAIL PROTECTED]
fixed multi-threading bug with cocoon1 reported by [EMAIL PROTECTED]
Revision Changes Path
1.11 +22 -10
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
Index: esql.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- esql.xsl 18 Feb 2002 09:35:17 -0000 1.10
+++ esql.xsl 20 Feb 2002 11:31:27 -0000 1.11
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<!-- $Id: esql.xsl,v 1.10 2002/02/18 09:35:17 haul Exp $-->
+<!-- $Id: esql.xsl,v 1.11 2002/02/20 11:31:27 tcurdt Exp $-->
<!--
============================================================================
@@ -56,7 +56,7 @@
* ESQL Logicsheet
*
* @author ?
- * @version CVS $Revision: 1.10 $ $Date: 2002/02/18 09:35:17 $
+ * @version CVS $Revision: 1.11 $ $Date: 2002/02/20 11:31:27 $
-->
<xsl:stylesheet version="1.0"
@@ -264,12 +264,9 @@
</xsl:if>
</xsp:structure>
<xsp:logic>
- private Stack _esql_connections = new Stack();
- private EsqlConnection<xsl:value-of select="$environment"/> _esql_connection
= null;
- private Stack _esql_queries = new Stack();
- private EsqlQuery _esql_query = null;
- private SQLException _esql_exception = null;
- private StringWriter _esql_exception_writer = null;
+ <xsl:if test="$environment = 'Cocoon2'">
+ <xsl:call-template name="variables"><xsl:with-param name="modifier"
select="'private'"/></xsl:call-template>
+ </xsl:if>
<xsl:if test=".//esql:connection/esql:pool">
<xsl:choose>
@@ -333,10 +330,25 @@
</xsp:page>
</xsl:template>
+<xsl:template name="variables">
+ <xsl:param name="modifier" select="''"/>
+ <xsp:logic>
+ <xsl:value-of select="$modifier"/> Stack _esql_connections = new Stack();
+ <xsl:value-of select="$modifier"/> EsqlConnection<xsl:value-of
select="$environment"/> _esql_connection = null;
+ <xsl:value-of select="$modifier"/> Stack _esql_queries = new Stack();
+ <xsl:value-of select="$modifier"/> EsqlQuery _esql_query = null;
+ <xsl:value-of select="$modifier"/> SQLException _esql_exception = null;
+ <xsl:value-of select="$modifier"/> StringWriter _esql_exception_writer = null;
+ </xsp:logic>
+</xsl:template>
+
<xsl:template match="xsp:page/*[not(self::xsp:*)]">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsp:logic>
+ <xsl:if test="$environment = 'Cocoon1'">
+ <xsl:call-template name="variables"/>
+ </xsl:if>
</xsp:logic>
<xsl:apply-templates/>
</xsl:copy>
@@ -461,11 +473,11 @@
if (_esql_query != null) {
_esql_queries.push(_esql_query);
}
- _esql_query = new EsqlQuery( _esql_connection, String.valueOf(<xsl:copy-of
select="$query"/>) );
+ _esql_query = new EsqlQuery( _esql_connection, String.valueOf(<xsl:copy-of
select="normalize-space($query)"/>) );
<xsl:if test="esql:max-rows">
try {
- _esql_query.setMaxRows( Integer.parseInt(String.valueOf(<xsl:copy-of
select="$maxrows"/>)) );
+ _esql_query.setMaxRows( Integer.parseInt(String.valueOf(<xsl:copy-of
select="normalize-space($maxrows)"/>)) );
} catch (NumberFormatException e) {}
</xsl:if>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]