You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ricardo Trindade <Ri...@myrealbox.com> on 2002/06/11 17:23:00 UTC

using pooled connection inside action or reader

Hi,

	I'm about to write an action or a reader (or both). They will be used to
generate reports with the JasperReports tool.

	To be able to use this tool, I have to pass it a connection to my
datasource.
	I was wondering if I will be able (inside the reader or action code) to
pass it one of the pooled connectios, and if so, if that would be a good
aproach.

	Would there be a problem, for example, if jasper closed the connection ?

thanks
Ricardo Trindade


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

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


RE: using pooled connection inside action or reader

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Ricardo Trindade [mailto:Ricardo.Trindade@myrealbox.com]
> 
> thanks. but I still wonder how to get it in the first place...

ComponentSelector selector = (ComponentSelector)
manager.lookup(DataSourceComponent.ROLE + "Selector");

DataSourceComponent datasource = (DataSourceComponent)
selector.select("poolname");

java.sql.Connection connection = datasource.getConnection();



Vadim


> 
> -----Original Message-----
> From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
> Sent: quarta-feira, 12 de Junho de 2002 14:05
> To: cocoon-users@xml.apache.org
> Subject: RE: using pooled connection inside action or reader
> 
> 
> > From: Ricardo Trindade [mailto:Ricardo.Trindade@myrealbox.com]
> >
> > Hi,
> >
> > 	I'm about to write an action or a reader (or both). They will be
> used to
> > generate reports with the JasperReports tool.
> >
> > 	To be able to use this tool, I have to pass it a connection to
> my
> > datasource.
> > 	I was wondering if I will be able (inside the reader or action
> code) to
> > pass it one of the pooled connectios, and if so, if that would be a
> good
> > aproach.
> >
> > 	Would there be a problem, for example, if jasper closed the
> connection ?
> 
> close() on database connection will just return it to the pool. This
> call is mandatory for all connections taken from the pool.
> 
> Vadim
> 
> >
> > thanks
> > Ricardo Trindade
> >
> >
> >
---------------------------------------------------------------------
> > Please check that your question  has not already been answered in
the
> > FAQ before posting.
<http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:
<co...@xml.apache.org>
> > For additional commands, e-mail:
<co...@xml.apache.org>
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>



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

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


RE: using pooled connection inside action or reader

Posted by Ricardo Trindade <Ri...@myrealbox.com>.
thanks. but I still wonder how to get it in the first place...

-----Original Message-----
From: Vadim Gritsenko [mailto:vadim.gritsenko@verizon.net]
Sent: quarta-feira, 12 de Junho de 2002 14:05
To: cocoon-users@xml.apache.org
Subject: RE: using pooled connection inside action or reader


> From: Ricardo Trindade [mailto:Ricardo.Trindade@myrealbox.com]
> 
> Hi,
> 
> 	I'm about to write an action or a reader (or both). They will be
used to
> generate reports with the JasperReports tool.
> 
> 	To be able to use this tool, I have to pass it a connection to
my
> datasource.
> 	I was wondering if I will be able (inside the reader or action
code) to
> pass it one of the pooled connectios, and if so, if that would be a
good
> aproach.
> 
> 	Would there be a problem, for example, if jasper closed the
connection ?

close() on database connection will just return it to the pool. This
call is mandatory for all connections taken from the pool.

Vadim

> 
> thanks
> Ricardo Trindade
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>


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

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



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

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


RE: using pooled connection inside action or reader

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Ricardo Trindade [mailto:Ricardo.Trindade@myrealbox.com]
> 
> Hi,
> 
> 	I'm about to write an action or a reader (or both). They will be
used to
> generate reports with the JasperReports tool.
> 
> 	To be able to use this tool, I have to pass it a connection to
my
> datasource.
> 	I was wondering if I will be able (inside the reader or action
code) to
> pass it one of the pooled connectios, and if so, if that would be a
good
> aproach.
> 
> 	Would there be a problem, for example, if jasper closed the
connection ?

close() on database connection will just return it to the pool. This
call is mandatory for all connections taken from the pool.

Vadim

> 
> thanks
> Ricardo Trindade
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>


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

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