You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Phil Friedman <pf...@terralink.com> on 2003/07/11 00:23:49 UTC

SQL XConnection

Once again I'm trying to upgrade from Xalan 2.0.1, this time to 2.5.1.
We use the SQL XConnection extensively to access Fox Pro, Sybase and MS
SQL Server databases. All of our original .xsl works fine with 2.0.1,
but not with 2.5.1. 

Basically, we have only been able to get correct results with a new
connection for each query, and must copy the results before using them.
Both of these seem to be performance and resource hits.

In the attached file, see comments starting with '<!--!' for some of the
problems and work-arounds we have found. This .xsl connects to Fox Pro,
but we have similar problems with the real databases as well.

Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101

Re: SQL XConnection

Posted by Phil Friedman <pf...@terralink.com>.
John,

Thanks for looking into the problems I'm having. I've e-mailed you
separately another set of files, a 2.0.1 version that works correctly
and a 2.5.1 version that does not. I've disabled streaming, don't copy
the results and don't reconnect to the database: the new symptoms are
that only the first row of the first result set is processed by for-each.
I can test a separate template here, but I'm not sure this would be
workable for all of my existing queries.

BTW, I was using $Qy//row-set instead of $Qy/sql/row-set because it is
compatible with both 2.5.1 and 2.0.1.

Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101

On Mon, 14 Jul 2003 14:39:20 -0700, John Gentilin <ge...@eyecatching.com> may have written:

|Phil,
|
| From what I can tell your problem is that your are selecting on 
|row-set/row. There is a bug
|in Xalan and the bug has been registered for a while now. I think it may 
|be incorrectly described
|as being an SQL bug, but it is really a function of the SortedWalker. 
|Here is a pointer to a message
|thread that started the whole discussion 
|http://marc.theaimsgroup.com/?l=xalan-dev&m=103051760126504&w=2
|There are two ways around this, disable streaming... or select on 
|row-set only and provide a template
|for the row match.
|
|Is there a reason why you are using $Qy//row-set instead of $Qy/row-set  ???
|
|Regards
|John G
|
|Phil Friedman wrote:
|
|>John,
|>
|>I've removed the dependencies on other files. I've attached a new
|>version WMAllOut201.xsl that yields correct results with Xalan 2.0.1 and
|>another WMAllOut251.xsl which is my attempt to get it working under
|>2.5.1. I have only been able to get it to work by 1) copying the results
|>before accessing them with xsl:for-each. 2) closing and reopening the
|>connection between each query.
|>
|>Both style sheets work, but 2.0.1 is immensely faster and I've got other
|>situations where these changes would be unworkable.
|>
|>Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101
|>
|>On Fri, 11 Jul 2003 00:34:56 -0700, John Gentilin <ge...@eyecatching.com> may have written:
|>
|>|Phil,
|>|
|>|Is that the entire XSL file, seems to be missing some of the templates.
|>| From what I can see, the XConnection#new is being called inside a
|>|template that may be losing scope, you may need to declare the template
|>|in a higher level template. Also the new() operator that takes parameters
|>|is being depreciated, the newer style is a new() then the connect() method.
|>|
|>|i.e.
|>|        <xsl:variable name="Xcon1" select="sql:new()"/>
|>|        <xsl:variable name="dbConResult" 
|>|select="sql:connect($Xcon1,'DQP_ConnPool')"/>
|>|
|>|Also do you have any other XSL files that may be a little more straight 
|>|forward.
|>|
|>|Each call to query creates a new JDBC Connection and that connection is 
|>|maintained
|>|throughout the life of the SQLDocument, the object returned from 
|>|query/pquery.
|>|The current code is CVS may be a bit unstable since I just checked in 
|>|some major
|>|changes to support in-line variables.
|>|
|>|-JG
|>|
|>|Phil Friedman wrote:
|>|
|>|>Once again I'm trying to upgrade from Xalan 2.0.1, this time to 2.5.1.
|>|>We use the SQL XConnection extensively to access Fox Pro, Sybase and MS
|>|>SQL Server databases. All of our original .xsl works fine with 2.0.1,
|>|>but not with 2.5.1. 
|>|>
|>|>Basically, we have only been able to get correct results with a new
|>|>connection for each query, and must copy the results before using them.
|>|>Both of these seem to be performance and resource hits.
|>|>
|>|>In the attached file, see comments starting with '<!--!' for some of the
|>|>problems and work-arounds we have found. This .xsl connects to Fox Pro,
|>|>but we have similar problems with the real databases as well.
|>|>
|>|>Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101
|>|>  
|>|>
|>|
|>|
|>  
|>
|
|-- 
|--------------------------------------
|John Gentilin
|Eye Catching Solutions Inc.
|18314 Carlwyn Drive
|Castro Valley CA 94546
|
|    Contact Info
|gentijo@eyecatching.com
|Ca Office 1-510-881-4821
|NJ Office 1-732-422-4917
|
|


Re: SQL XConnection

Posted by John Gentilin <ge...@eyecatching.com>.
Phil,

 From what I can tell your problem is that your are selecting on 
row-set/row. There is a bug
in Xalan and the bug has been registered for a while now. I think it may 
be incorrectly described
as being an SQL bug, but it is really a function of the SortedWalker. 
Here is a pointer to a message
thread that started the whole discussion 
http://marc.theaimsgroup.com/?l=xalan-dev&m=103051760126504&w=2
There are two ways around this, disable streaming... or select on 
row-set only and provide a template
for the row match.

Is there a reason why you are using $Qy//row-set instead of $Qy/row-set  ???

Regards
John G

Phil Friedman wrote:

>John,
>
>I've removed the dependencies on other files. I've attached a new
>version WMAllOut201.xsl that yields correct results with Xalan 2.0.1 and
>another WMAllOut251.xsl which is my attempt to get it working under
>2.5.1. I have only been able to get it to work by 1) copying the results
>before accessing them with xsl:for-each. 2) closing and reopening the
>connection between each query.
>
>Both style sheets work, but 2.0.1 is immensely faster and I've got other
>situations where these changes would be unworkable.
>
>Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101
>
>On Fri, 11 Jul 2003 00:34:56 -0700, John Gentilin <ge...@eyecatching.com> may have written:
>
>|Phil,
>|
>|Is that the entire XSL file, seems to be missing some of the templates.
>| From what I can see, the XConnection#new is being called inside a
>|template that may be losing scope, you may need to declare the template
>|in a higher level template. Also the new() operator that takes parameters
>|is being depreciated, the newer style is a new() then the connect() method.
>|
>|i.e.
>|        <xsl:variable name="Xcon1" select="sql:new()"/>
>|        <xsl:variable name="dbConResult" 
>|select="sql:connect($Xcon1,'DQP_ConnPool')"/>
>|
>|Also do you have any other XSL files that may be a little more straight 
>|forward.
>|
>|Each call to query creates a new JDBC Connection and that connection is 
>|maintained
>|throughout the life of the SQLDocument, the object returned from 
>|query/pquery.
>|The current code is CVS may be a bit unstable since I just checked in 
>|some major
>|changes to support in-line variables.
>|
>|-JG
>|
>|Phil Friedman wrote:
>|
>|>Once again I'm trying to upgrade from Xalan 2.0.1, this time to 2.5.1.
>|>We use the SQL XConnection extensively to access Fox Pro, Sybase and MS
>|>SQL Server databases. All of our original .xsl works fine with 2.0.1,
>|>but not with 2.5.1. 
>|>
>|>Basically, we have only been able to get correct results with a new
>|>connection for each query, and must copy the results before using them.
>|>Both of these seem to be performance and resource hits.
>|>
>|>In the attached file, see comments starting with '<!--!' for some of the
>|>problems and work-arounds we have found. This .xsl connects to Fox Pro,
>|>but we have similar problems with the real databases as well.
>|>
>|>Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101
>|>  
>|>
>|
>|
>  
>

-- 
--------------------------------------
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

    Contact Info
gentijo@eyecatching.com
Ca Office 1-510-881-4821
NJ Office 1-732-422-4917





Re: SQL XConnection

Posted by Phil Friedman <pf...@terralink.com>.
John,

I've removed the dependencies on other files. I've attached a new
version WMAllOut201.xsl that yields correct results with Xalan 2.0.1 and
another WMAllOut251.xsl which is my attempt to get it working under
2.5.1. I have only been able to get it to work by 1) copying the results
before accessing them with xsl:for-each. 2) closing and reopening the
connection between each query.

Both style sheets work, but 2.0.1 is immensely faster and I've got other
situations where these changes would be unworkable.

Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101

On Fri, 11 Jul 2003 00:34:56 -0700, John Gentilin <ge...@eyecatching.com> may have written:

|Phil,
|
|Is that the entire XSL file, seems to be missing some of the templates.
| From what I can see, the XConnection#new is being called inside a
|template that may be losing scope, you may need to declare the template
|in a higher level template. Also the new() operator that takes parameters
|is being depreciated, the newer style is a new() then the connect() method.
|
|i.e.
|        <xsl:variable name="Xcon1" select="sql:new()"/>
|        <xsl:variable name="dbConResult" 
|select="sql:connect($Xcon1,'DQP_ConnPool')"/>
|
|Also do you have any other XSL files that may be a little more straight 
|forward.
|
|Each call to query creates a new JDBC Connection and that connection is 
|maintained
|throughout the life of the SQLDocument, the object returned from 
|query/pquery.
|The current code is CVS may be a bit unstable since I just checked in 
|some major
|changes to support in-line variables.
|
|-JG
|
|Phil Friedman wrote:
|
|>Once again I'm trying to upgrade from Xalan 2.0.1, this time to 2.5.1.
|>We use the SQL XConnection extensively to access Fox Pro, Sybase and MS
|>SQL Server databases. All of our original .xsl works fine with 2.0.1,
|>but not with 2.5.1. 
|>
|>Basically, we have only been able to get correct results with a new
|>connection for each query, and must copy the results before using them.
|>Both of these seem to be performance and resource hits.
|>
|>In the attached file, see comments starting with '<!--!' for some of the
|>problems and work-arounds we have found. This .xsl connects to Fox Pro,
|>but we have similar problems with the real databases as well.
|>
|>Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101
|>  
|>
|
|

Re: SQL XConnection

Posted by John Gentilin <ge...@eyecatching.com>.
Phil,

Is that the entire XSL file, seems to be missing some of the templates.
 From what I can see, the XConnection#new is being called inside a
template that may be losing scope, you may need to declare the template
in a higher level template. Also the new() operator that takes parameters
is being depreciated, the newer style is a new() then the connect() method.

i.e.
        <xsl:variable name="Xcon1" select="sql:new()"/>
        <xsl:variable name="dbConResult" 
select="sql:connect($Xcon1,'DQP_ConnPool')"/>

Also do you have any other XSL files that may be a little more straight 
forward.

Each call to query creates a new JDBC Connection and that connection is 
maintained
throughout the life of the SQLDocument, the object returned from 
query/pquery.
The current code is CVS may be a bit unstable since I just checked in 
some major
changes to support in-line variables.

-JG

Phil Friedman wrote:

>Once again I'm trying to upgrade from Xalan 2.0.1, this time to 2.5.1.
>We use the SQL XConnection extensively to access Fox Pro, Sybase and MS
>SQL Server databases. All of our original .xsl works fine with 2.0.1,
>but not with 2.5.1. 
>
>Basically, we have only been able to get correct results with a new
>connection for each query, and must copy the results before using them.
>Both of these seem to be performance and resource hits.
>
>In the attached file, see comments starting with '<!--!' for some of the
>problems and work-arounds we have found. This .xsl connects to Fox Pro,
>but we have similar problems with the real databases as well.
>
>Regards,  Philip Friedman -- Terralink Software Systems -- 207-772-6500 x101
>  
>