balld 00/08/27 09:47:06
Modified: src/org/apache/cocoon/processor/xsp/library/sql esql.xsl
Log:
patched it to hopefully avoid 64k method problem
Revision Changes Path
1.4 +26 -17
xml-cocoon/src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl
Index: esql.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- esql.xsl 2000/08/26 04:01:33 1.3
+++ esql.xsl 2000/08/27 16:47:05 1.4
@@ -103,7 +103,21 @@
</xsp:structure>
<xsp:logic>
static DBBroker _esql_pool = DBBroker.getInstance();
+ class EsqlSession {
+ DBConnection db_connection;
+ Connection connection;
+ boolean close_connection = true;
+ Statement statement;
+ ResultSet resultset;
+ ResultSetMetaData resultset_metadata;
+ int count;
+ int max_rows;
+ int skip_rows;
+ }
+ Stack _esql_sessions = new Stack();
+ EsqlSession _esql_session = null;
</xsp:logic>
+ <xsl:apply-templates select=".//esql:execute-query"
mode="generate-method"/>
<xsl:apply-templates/>
</xsp:page>
</xsl:template>
@@ -111,21 +125,6 @@
<xsl:template match="xsp:page/*">
<xsl:copy>
<xsl:apply-templates select="@*"/>
- <xsp:logic>
- class EsqlSession {
- DBConnection db_connection;
- Connection connection;
- boolean close_connection = true;
- Statement statement;
- ResultSet resultset;
- ResultSetMetaData resultset_metadata;
- int count;
- int max_rows;
- int skip_rows;
- }
- Stack _esql_sessions = new Stack();
- EsqlSession _esql_session = null;
- </xsp:logic>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
@@ -137,7 +136,10 @@
</xsl:template>
<xsl:template match="esql:execute-query">
- <xsl:variable name="prefix">_esql_<value-of
select="generate-id"/>_</xsl:variable>
+ <xsp:logic>_esql_execute_query_<xsl:value-of
select="generate-id(.)"/>(request,response,document,xspParentNode,xspCurrentNode,xspNodeStack,session);</xsp:logic>
+</xsl:template>
+
+<xsl:template match="esql:execute-query" mode="generate-method">
<xsl:variable name="use-connection">
<xsl:call-template name="get-nested-string">
<xsl:with-param name="content"
select="esql:use-connection"/>
@@ -179,7 +181,14 @@
</xsl:call-template>
</xsl:variable>
<xsp:logic>
- {
+ void _esql_execute_query_<xsl:value-of select="generate-id(.)"/>(
+ HttpServletRequest request,
+ HttpServletResponse response,
+ Document document,
+ Node xspParentNode,
+ Node xspCurrentNode,
+ Stack xspNodeStack,
+ HttpSession session) throws Exception {
if (_esql_session != null) {
_esql_sessions.push(_esql_session);
}