Hi,

I've discovered serious bug in esql logicsheet while using it with
cocoon-1.8.3. However the same bug seems to exists in cocoon2. The
problem is that while node stack logic variables (xspParentNode,
xspCurrentNode, xspNodeStack) are defined inside populateDocument
method, similar objects used by esql (_esql_connections etc...) exist as
object attributes.

Since there is only one instance of particular xsp page (eg.
_index.class) per application, under havy load it is possible (and easy
to observe using eg jmeter) that concurent calls to the same
_index.populateDocument method will lead esql structures and connection
pools to be corrupted.

you can find attached the patch that should fix thing up (it works at
least with cocoon-1.8.x)

regards,

Szymon


--- 
xml-cocoon2-orig/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
    Tue Feb 19 14:13:21 2002
+++ 
+xml-cocoon2-patched/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
+ Tue Feb 19 21:02:01 2002
@@ -249,13 +249,6 @@
       </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=".//esql:connection/esql:pool">
         <xsl:choose>
           <xsl:when test="$environment = 'Cocoon1'">
@@ -322,6 +315,13 @@
   <xsl:copy>
     <xsl:apply-templates select="@*"/>
     <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;
+      
     </xsp:logic>
     <xsl:apply-templates/>
   </xsl:copy>


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

Reply via email to