cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Larsson" <max.lars...@gmservice.de>
Subject RE: C2.0: connection pool/ datasource problem
Date Wed, 17 Oct 2001 05:59:48 GMT
Hi,

i had the same problem for some time until i came
behind it. This exception is thrown if no Connections
are availble in db pool. This can happen if the pool
couldn't be created at startup. But that's normally
a configiration issue ans is quiet fats solved.
The other circumstences it can apear is, if you
programmed a lot of own actions or simliar
extensions to C2, where you request a db connection
but forgets to give it back to pool. E.g. forget
to make close call on the connection object. Since
i discovred that i always useing somthing like that

Connection con = datasource.getConnetcion();

try {
	... // do your sql stuff

	con.commit();
}
catch( SQLException exc ) {
	if( con != null )
		con.rollback();

	//rethrow it
	throw exc;
}
finally {
	if( con != null )
		con.close();		// give it back to the pool
}



Now i only get the erro, if i trying to request
have more connections from the pool than it has.

HTH

Max
-----Original Message-----
From: Russell Castagnaro [mailto:russell@castagnaro.com]
Sent: Dienstag, 16. Oktober 2001 19:21
To: cocoon-users@xml.apache.org
Subject: C2.0: connection pool/ datasource problem


Aloha folks,

I'm having a strange problem with C2 for All db connections

I've tried using mysql and oracle and they both have the same
problem..

I'm preloading the driver classes and I've tested my db connections.
The error I get when using the esql taglib is:

org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate():
java.lang.RuntimeException: Could not get the datasource
java.sql.SQLException:
There are no connections in the pool, check your settings.
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenera
tor.java:187)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv
entPipeline.java:214)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS
treamPipeline.java:364)
at
org.apache.cocoon.www.sitemap_xmap.wildcardMatchN40043E(sitemap_xmap.java:57
40)
at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2593)
at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2205)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:163)

Why wouldn't any connections be available?

I'm using:

  <datasources>
    <jdbc name="fun">
      <pool-controller min="5" max="10" oradb="true"/>
      <dburl>jdbc:oracle:thin:@localhost:1521:ORCL</dburl>
      <user>scott</user>
      <password>tiger</password>
    </jdbc>

    and
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:esql="http://apache.org/cocoon/SQL/v2"
>

  <page>
   <title>A Database Driven XSP Page</title>
   <content>

   <esql:connection>
     <esql:pool>fun</esql:pool>
     <esql:execute-query>
       <esql:query>Select * from EMP</esql:query>
       <esql:results>
         <esql:row-results>
           <para><esql:get-string column="ename"/></para>
           <esql:get-columns/>
         </esql:row-results>
       </esql:results>
     </esql:execute-query>
   </esql:connection>

   </content>
  </page>
</xsp:page>
</xsp:page>

any ideas??





--
Best regards,
 Russell                          mailto:russell@castagnaro.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message