cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: xsp with sql worked in cocoon1.7.4 but not in 1.8 anymore ?!
Date Thu, 05 Oct 2000 13:42:47 GMT
"Gabi Brysch" <brysch@inxnet.de> wrote:
>i had some xsp's samples including sql-tags which worked in cocoon 1.7.4
>without problems - but now i used them
>with cocoon 1.8 and they don't work anymore - what's wrong ???
>
>this is the exception i get:
> >
>java.sql.SQLException: General error
>	at sun.jdbc.odbc.JdbcOdbc.throwGenericSQLException(JdbcOdbc.java:6160)
>	at sun.jdbc.odbc.JdbcOdbc.SQLFreeEnv(JdbcOdbc.java:2742)
>	at sun.jdbc.odbc.JdbcOdbcDriver.closeConnection(JdbcOdbcDriver.java:838)
>	at sun.jdbc.odbc.JdbcOdbcConnection.close(JdbcOdbcConnection.java:736)
>	at
>org.apache.cocoon.processor.xsp.library.sql.XSPSQLLibrary.executeQuery(XSPSQ
>LLibrary.java:185)
>	at
>_D_._CocoonProjekt._jakartaTomcat31._jakarta_tomcat._webapps._intranet._tran
>sformTwoDB._testDB2.populateDocument(_testDB2.java:104)
>	at org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
>	at
>org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:494)
>	at org.apache.cocoon.Engine.handle(Engine.java:359)
>	at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
>	at
>org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
>	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
>	at
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
>onnectionHandler.java:160)
>	at
>org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
>)
>	at java.lang.Thread.run(Thread.java:484)
> >

Thanks, you found a bug. It looks like this bit

if (!st.execute(query)) {
	    	/** this returns the number of rows we updated, or -1 on error **/
            int update_rows = st.getUpdateCount();
            if (results_element != null && 
!"".equals(update_rows_attribute)) {
                
results_element.setAttribute(update_rows_attribute,""+update_rows);
            }        }

in XSPSQLLibrary should close the statement, but it doesn't. If you look at 
the 1.7.4 code this is correct in 1.7.4. But Donald knows the code better, 
so I'll let him fix it. What kind of query were you running, anyway?

>
>the jdbc-odbc-bridge - driver doesn't appear in the cocoon.properties file 
>-
>this might be the reason ???

No, it doesn't look like you're using the connection pool. To use the 
connection pool you have to specify a connection name in 
<sql:use-connection> instead of url, password etc. to the tags.



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message