-0500
From: anji...@hotmail.com
To: user@struts.apache.org
Subject: Connection Pooling with Struts
I have to do DB connection (Oracle 10g) in my application developed in
Struts 1.3.8.
Currently I am implementing JDBC. As far I understand this is not a good
technique for real project. So I am hopi
Anjib,
i'd certainly take a look at hibernate, i've been using it for a while now and
find it easy enough and functionally rich enough for most things.
adam
> Date: Tue, 7 Dec 2010 14:36:01 -0500
> From: anji...@hotmail.com
> To: user@struts.apache.org
> Subject: C
ate: Tue, 7 Dec 2010 16:19:48 -0600
> Subject: Re: Connection Pooling with Struts
> From: stanl...@gmail.com
> To: user@struts.apache.org
>
> Dude, I can't sit quietly any longer! How you connect to a database has
> NOTHING WHATSOEVER to do with the Struts/2 Framework. I woul
Componenet instead of framework?
>>>
>>> Anjib
>>>
>>> E.g -. http://commons.apache.org/dbcp/
>>>
>>>> On Tue, Dec 7, 2010 at 4:27 PM, Dave Newton
>>>> wrote:
>>>>
>>>> A connection pooling library?
>
On Tue, Dec 7, 2010 at 6:15 PM, Anjib wrote:
> I am asking about ORM tool not Struts framework itself.
>
I think the point was more along the lines of "why are you asking here,"
since you're not asking about the Struts framework.
Dave
instead of framework?
Anjib
E.g -. http://commons.apache.org/dbcp/
On Tue, Dec 7, 2010 at 4:27 PM, Dave Newton
wrote:
A connection pooling library?
On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepati
wrote:
Ok now I get confuse. I was thinking simple JDBC can't (or complex to )
handle con
o Struts/2
as a Database connection.
On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati wrote:
> So I can use this DBCP Componenet instead of framework?
>
> Anjib
>
> E.g -. http://commons.apache.org/dbcp/
>>
>> On Tue, Dec 7, 2010 at 4:27 PM, Dave Newton
>>
So I can use this DBCP Componenet instead of framework?
Anjib
E.g -. http://commons.apache.org/dbcp/
On Tue, Dec 7, 2010 at 4:27 PM, Dave Newton wrote:
A connection pooling library?
On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepati
wrote:
Ok now I get confuse. I was thinking simple JDBC
E.g -. http://commons.apache.org/dbcp/
On Tue, Dec 7, 2010 at 4:27 PM, Dave Newton wrote:
> A connection pooling library?
>
> On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepati
> wrote:
>
> > Ok now I get confuse. I was thinking simple JDBC can't (or complex to )
> &g
A connection pooling library?
On Tue, Dec 7, 2010 at 4:25 PM, Anjib Mulepati wrote:
> Ok now I get confuse. I was thinking simple JDBC can't (or complex to )
> handle connection pooling. So framework make work easy. If framework is not
> used what are other alternatives to han
Ok now I get confuse. I was thinking simple JDBC can't (or complex to )
handle connection pooling. So framework make work easy. If framework is
not used what are other alternatives to handle connection pooling beside
JDBC itself?
Anjib
On 12/7/2010 4:20 PM, Arthur Neves wrote:
Nop,
Is the question about connection pooling, as the subject line indicates, or
is the question about generic DB handling and JDBC v. ORMs?
Dave
On Tue, Dec 7, 2010 at 4:20 PM, Arthur Neves wrote:
> Nop,
>
> You dont need using a framework... if you pick one just will make your life
>
Nop,
You dont need using a framework... if you pick one just will make your life
easier!
If you`re starting a new project I`d get one framework, however if the
project it`s already ready, just keep doing in the same way!
On Tue, Dec 7, 2010 at 3:36 PM, Anjib Mulepati wrote:
> I was thinking for
I was thinking for Hibernate.
So only way for struts is use one of these framework?
Anjib
On 12/7/2010 3:26 PM, Johannes Geppert wrote:
in java you have the choose which way is the best for your project to handle
databases.
there exists several frameworks for this job like hibernate, myBatis,
http://twitter.com/jogep
--
View this message in context:
http://old.nabble.com/Connection-Pooling-with-Struts-tp30399631p30400023.html
Sent from the Struts - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail
I have to do DB connection (Oracle 10g) in my application developed in
Struts 1.3.8.
Currently I am implementing JDBC. As far I understand this is not a good
technique for real project. So I am hoping someone could suggest me how
to do DB handling efficiently?
Thanks
Anjib
-
AFAIK, there is no pattern.
You can configure a datasource through Spring, or you could get it
from JNDI once when your app starts (by writing a
ServletContextListener)
2008/8/20, Roger <[EMAIL PROTECTED]>:
> I need to implement a database connection pool and was considering using the
> JNDI faci
I need to implement a database connection pool and was considering using the
JNDI facilities provided by the servlet container (in my case, Apache
Tomcat). Is there a Struts "pattern" for accessing JNDI resources in (a) a
container neutral manner and (b) without tying my action classes to the
s
--- RajiR <[EMAIL PROTECTED]> wrote:
> As struts2 comes along with spring integration with
> struts2-spring-plugin-2.0.11.jar,after starting the tomcat server its
> unable to load that jar and getting an exception as:
Looks more like you don't have Spring itself on your classpath:
> Caused by: ja
since Spring provides all sorts of
>> help in configuring and using data sources and the database beneath them
>> :-)
>>
>> L.
>>
>> RajiR wrote:
>>> Hi,
>>>
>>> In this link :
>>> http://dev.mysql.com/tech-resourc
dont forget to share the code.
Thx
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ase beneath them
> :-)
>
> L.
>
> RajiR wrote:
>> Hi,
>>
>> In this link :
>> http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html,
>> we can preform connection pooling only after configuring it in our
>> configuration files.
> eg.
> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
is this connectio data source is the best implementation
we are using hibernate c3p0, any suggestion
F
-
To unsubscribe, e-mail: [EMAIL PROTECT
d the database beneath them :-)
L.
RajiR wrote:
Hi,
In this link :
http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html,
we can preform connection pooling only after configuring it in our
configuration files.If it is in the case of struts1, struts-config.xml file
http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html,
we can preform connection pooling only after configuring it in our
configuration files.If it is in the case of struts1, struts-config.xml file
has a tag called and there we can configure.But,what about
struts2 ho
Hi,
In this link :
http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html,
we can preform connection pooling only after configuring it in our
configuration files.If it is in the case of struts1, struts-config.xml file
has a tag called and there we can configure.But
hi there
i got a too many connection when try use spring-hibernate with struts2
and this is not struts2 problem
i think the connection pool is not struts2 responsibility as the controller
and if we use spring, this will become injection work with the
database tech like ORM ot JDBC
F
-
RajiR wrote:
Can't we implement connection pooling in struts2 alone?If so ,may I know the
reason please...!!!
Thanks.
Struts 2 itself doesn't provide a connection pooling implementation and
probably shouldn't.
MySql provide a pooled DataSource that you can use immediate
Can't we implement connection pooling in struts2 alone?If so ,may I know the
reason please...!!!
Thanks.
nuwan chandrasoma-2 wrote:
>
> Hi,
>
> Why do not you give a try with Spring. as struts2 has built in support
> for spring, you can use springs connection
Hi,
Why do not you give a try with Spring. as struts2 has built in support
for spring, you can use springs connection pooling very easily.
Thanks,
Nuwan.
RajiR wrote:
Hi All,
Since struts1 has connection pooling mechanism using tag,what
is the procedure of connection pooling mechanism
Hi All,
Since struts1 has connection pooling mechanism using tag,what
is the procedure of connection pooling mechanism in struts2?
Can we do tht using tag?I have seen from some
of the search results for oracle db using
class:oracle.jdbc.pool.OracleConnectionCacheImpl. But I need
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jasdeep,
jasdeep wrote:
> Yes this is peek load actually .. The requests are through SMS's which
> is forwarded by kannel server to my application . actually we are in
> development phase and we are testing it as per client specifications.
>
> So thi
---------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Connection-Pooling--How-To---tf3796605.html#a10757338
Sent from the Struts - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jasdeep,
jasdeep wrote:
> 2. Configuring Jboss's Internal Container Level Connection pooling simply
> creating the datasources
This is the right way to do things.
> The application works OK with Second method but When it is being h
Hi All ,
i am developing a struts based web-application with JBoss 4.0.5 as
Application Server and Oracle 10g Express edition .
I am configuring my application for connection pooling .
I have tried following methods :
1. Oracle Connection Pooling following thius link
http
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Balazs,
Balazs Michnay wrote:
> 2) open your server.xml and put the following lines between
> tags (this is what I
> missed...)
> (Modify it properly...)
Although this is possible, most will recommend against it (including
me). This will create a
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Balazs,
Balazs Michnay wrote:
> Thanks for helping.
> Sure, here are all my settings.
I think you have more configuration than you need. Here is exactly what
I have for a similar setup (MySQL 5.x, Connector/J 5.x, Tomcat 5.5.x):
I checked, and
Many thanks for your help, I managed to set connection pooling up (however, I
don't know whether it uses conn. pooling or not...)
To help others, here are all the configurations that need to be done:
(This works with Tomcat 5.5, MySQL 5.0, Win XP SP2)
1) Place your database driver in
Hi,
Struts way (not good)
Connection pooling is not available in latest version of struts
1 and
struts 2. So if you upgrade your application to latest struts
then you
will be in trouble.
Server (JNDI) very good
All application servers provide
Hi
To set up connection pooling in struts which is the recommended way whether and
please explain the benifts
1) Configure through struts-config
2) Configure through Server (like in tomcat data-source configuration)
Thanks & Regards,
Saravanan Vijayappan,
+91 944883
OTECTED]>
To: "Struts Users Mailing List"
Sent: Tuesday, May 22, 2007 7:34 AM
Subject: Re: [OT] Connection Pooling
I forgot that I also have a resource-ref entry in my web.xml file... just
in case it counts...
DB Connection
jdbc/akr_db
javax.sql.DataSource
TED]>
To: Struts Users Mailing List
Sent: Tuesday, May 22, 2007 2:33:34 PM
Subject: Re: [OT] Connection Pooling
hi,
i just had a look, i think your url is wrong.
where is the DB name?
eg:- you have it like jdbc:mysql://localhost:3306
but should be like: jdbc:mysql://localhost:3306/akr_db
--- Original Message
From: Nuwan Chandrasoma <[EMAIL PROTECTED]>
To: Struts Users Mailing List
Sent: Tuesday, May 22, 2007 2:33:34 PM
Subject: Re: [OT] Connection Pooling
hi,
i just had a look, i think your url is wrong.
where is the DB name?
eg:- you have it like jdbc:mysql://localhost:
o: "Struts Users Mailing List"
Sent: Tuesday, May 22, 2007 6:39 AM
Subject: Re: [OT] Connection Pooling
Thanks for helping.
Sure, here are all my settings.
I use MySQL 5.0.37, Tomcat 5.5.17 and Windows XP SP2 and MySQL Connector/J
5.0.5.
The name of the database that I'd like to con
a JSP, in which I'd like to use my connection pool:
-- DBTEST.JSP
...
<%
db_helpers.DBTest tst = new db_helpers.DBTest();
tst.init();
%>
Results
Foo <%= tst.getFoo() %>
Bar <%= tst.getBar() %>
...
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Balazs,
Balazs Michnay wrote:
> I still cannot estabilish database connection using connection pooling.
> I think I made all the settings I need, but still nothing...
> 1) I have a tag in my server.xml
Can you show us the connection set
Hi there,
This post might not be struts-related, but I read so many posts on this issue,
that I thought I might ask...
Having read all the posts, I still cannot estabilish database connection using
connection pooling.
I think I made all the settings I need, but still nothing...
1) I have a tag
Hi Mohan,
Following url will definetly solve your problem.
http://www.roseindia.net/struts/strutsdatasourcemanagerontomcat5.shtml
Regards
Deepak Kumar
"A.Mohan" <[EMAIL PROTECTED]> wrote:
Hi,
I want to connect Oracle thro DBCP - connection pooling by
configuring the d
You also need configure server.xml, please check out Tomcat document for the
configuration and call Data Source using JNDI from Struts.
Good luck.
On 11/9/05, A.Mohan <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I want to connect Oracle thro DBCP - connection pooling by
> configuring
Show us what you have so far and then we can help.
Kind regards
mc
On 8 Nov 2005 at 20:49, A.Mohan wrote:
> Hi,
>I want to connect Oracle thro DBCP - connection pooling by
> configuring the datasource in the WEB.XML file ,
> Im using Apache tomcat Server
>
>
> H
Hi,
I want to connect Oracle thro DBCP - connection pooling by
configuring the datasource in the WEB.XML file ,
Im using Apache tomcat Server
How can i acheive that - help me out ,
I want the following information
1. Configuration in web.xml file i.e the entries
2. Code in action
default connection pooling with mysql. In future we may migrate to Oracle or SQL Server 2000 . Can you please tell me the best way of implementing connection pooling in struts with database as MySQL and Oracle 9i.
Thanks
Tushar Agrawal
-
Do you Yahoo
Subject: Connection Pooling With Struts
Hi Freinds,
I am using struts-config default connection pooling with mysql. In future we
may migrate to Oracle or SQL Server 2000 . Can you please tell me the best
way of implementing connection pooling in struts with database as MySQL and
Oracle 9i
Hi Freinds,
I am using struts-config default connection pooling with mysql. In future we may
migrate to Oracle or SQL Server 2000 . Can you please tell me the best way of
implementing connection pooling in struts with database as MySQL and Oracle 9i.
Thanks
Tushar Agrawal
-
From: LINGALA, AMARESHWAR G (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 2:08 PM
To: Struts Users Mailing List
Subject: Connection pooling problem
> Hi,
> I am trying to set-up Connection pooling for my web application,
> I have made the following modificatio
> Hi,
> I am trying to set-up Connection pooling for my web application,
> I have made the following modifications to my server.xml file.
>
>
>
>
>
>
>
>
>
>
>
>className="org.apache.catalina.mbeans.ServerLifecycle
> -Original Message-
> From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 17, 2004 7:18 AM
> To: Struts Users Mailing List
> Subject: RE: connection pooling
>
>
> Suppose I will put following code in my struts-config.xml instead of
> tomca
nal Message-
> > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 16, 2004 3:16 PM
> > To: Struts Users Mailing List
> > Subject: RE: connection pooling
> >
> >
> > Jim,
> > I understand most part of it now. the only thing th
> -Original Message-
> From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 16, 2004 3:16 PM
> To: Struts Users Mailing List
> Subject: RE: connection pooling
>
>
> Jim,
> I understand most part of it now. the only thing that i dont
&
Jim,
I understand most part of it now. the only thing that i dont
understand is how will the connection pooling be handled. I am using
tomcat 5. will the following code(from the link that u sent me) serve
the purpose?
.
.
.
..
regards
saurabh
On Mon, 2004-08-16 at 16
,
org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn.java for
more details.
Regards,
Sridhar
-Original Message-
From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
Sent: Monday, August 16, 2004 2:24 PM
To: Struts Users Mailing List
Subject: Re: connection pooling
David,
But i want to make a business layer and call the DAO from there. I
yeah, I am planning to use OJB for persistence. Thankx for your advice.
regards
saurabh
On Mon, 2004-08-16 at 16:43, David Durham wrote:
> Jim Barrows wrote:
>
> > Ah, okay.. I also posted a link to the struts way to do the JNDI data
> > source stuff in that case.. you follow your web app s
> -Original Message-
> From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 16, 2004 2:42 PM
> To: Struts Users Mailing List
> Subject: RE: connection pooling
>
>
> Jim,
>I am sorry but I am confused now. Just correct me if I am
> w
Jim Barrows wrote:
Ah, okay.. I also posted a link to the struts way to do the JNDI data
source stuff in that case.. you follow your web app servers guide
on how to setup a data source, then you follow the destructions for a
normal jndi data source. Something like:
Additionally, Saurabh, hav
PM
> > To: Struts Users Mailing List
> > Subject: Re: connection pooling
> >
> >
> > David,
> > But i want to make a business layer and call the DAO from there. I
> > think that the links that you have sent me couple
> > presentation layer and
> -Original Message-
> From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 16, 2004 2:24 PM
> To: Struts Users Mailing List
> Subject: Re: connection pooling
>
>
> David,
> But i want to make a business layer and call the DAO from there
David,
But i want to make a business layer and call the DAO from there. I
think that the links that you have sent me couple presentation layer and
database tightly. I know i can use EJB for presentation layer but I dont
want that as it would be overkill for the small project I am working on.
I w
> -Original Message-
> From: David Durham [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 16, 2004 2:01 PM
> To: Struts Users Mailing List
> Subject: Re: connection pooling
>
>
> Saurabh Bhatla wrote:
>
> > Now i want to
> > know how to initia
David Durham wrote:
I think you want to look at a piece of technology called JNDI.
Here's a link to Tomcat's JNDI Datasource How-To:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
Considering the list topic, I guess I should post this link instead:
http://st
Saurabh Bhatla wrote:
Now i want to
know how to initialize the connection pool object and how to pass that
object to all Action classes.
I think you want to look at a piece of technology called JNDI.
Here's a link to Tomcat's JNDI Datasource How-To:
http://jakarta.apache.org/tomcat/tomcat-5.0-do
Hi all,
I have just started working with struts a few days ago, and I
understand most of it. The only thing that i dont understand is, if i
make a connection pool then where will it be initialized. In servlets I
know that it can be done in the init() method but in struts framework
there is noth
[mailto:[EMAIL PROTECTED]
Sent: 09 July 2004 12:23
To: Struts Users Mailing List
Subject: Re: how to disable struts connection pooling logs
Veera, you need to configure commons logging to control these INFO
messages: I've documented what to do in a short article:
http://otn.oracle.com/prod
Re: how to disable struts connection pooling logs
Veera, you need to configure commons logging to control these INFO
messages: I've documented what to do in a short article:
http://otn.oracle.com/products/jdev/tips/mills/Struts-logging.html
Regards
Duncan Mills
http://www.groundside.co
ation developed on struts 1.1 , deployed on Tomcat 4.1.
We use Postgres as backend database. We also use Struts connection pooling mechanism.
The problem I am facing is the following entries in the stderr.log file.
Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection
Hi,
I have web application developed on struts 1.1 , deployed on Tomcat 4.1.
We use Postgres as backend database. We also use Struts connection pooling mechanism.
The problem I am facing is the following entries in the stderr.log file.
Jul 9, 2004 9:13:59 AM
Check
http://jakarta.apache.org/commons/dbcp/configuration.html
's abandanded something parameters.
I am not sure about how to apply this to Struts Datasource.
I've just replaced Struts Datasouce with tomcat JNDI datasource with DBCP.
to decouple Struts and DAOs.
Masashi
At 12:55 04/06/09 +0530,
Thanks for your attention.
"Abandand connection management" can you give more details on how to do this.
Masashi Nakane wrote:
> And if you have a chance to try DBCP , Abandand connection management
> function will tell you exactly where the unclosed connections are . You
> will love th
>
> Like I said though, this is the brute-force approach, I don't know a
> 'good' way to do this off hand.
>
> On Wed, 09 Jun 2004 11:14:40 +0530, Shailender Jain
> <[EMAIL PROTECTED]> wrote:
> >
> > I have fished developing the application using Struts
And if you have a chance to try DBCP , Abandand connection management
function will tell you exactly where the unclosed connections are . You
will love this.
Masashi
At 23:33 04/06/08 -0700, you wrote:
"And Some other guy says the set the max number of connectons to 1."
Yes this is another
"And Some other guy says the set the max number of connectons to 1."
Yes this is another good way, thank you for bringing that up. I had a
fairly big app that was throwing away connections and when I set the
max connections to 1 it became almost immediately aparent where the
problem was.
Good sug
with eachother.
Like I said though, this is the brute-force approach, I don't know a
'good' way to do this off hand.
On Wed, 09 Jun 2004 11:14:40 +0530, Shailender Jain
<[EMAIL PROTECTED]> wrote:
>
> I have fished developing the application using Struts and Tomcat 5.0.
Struts and Tomcat 5.0.16
> as server.
>
> We used the Connection Pooling provided by Struts (DBCP)
>
> After the development we have realized that somewhere in the application
> the connection is not
> getting closed. Due to this the application is getting hang very
> frequently
I have fished developing the application using Struts and Tomcat 5.0.16
as server.
We used the Connection Pooling provided by Struts (DBCP)
After the development we have realized that somewhere in the application
the connection is not
getting closed. Due to this the application is getting hang
Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>
To
Struts Users Mailing List
<[EMAIL PROTECTED]>
cc
Subject
connection pooling
hi all
i have a doubt over connection pooling.When 5 users are using a project
in
struts and if i have defined the
If your pool max is 4, then you will see 4 and your 5th user will wait
until someone returns their connection to the pool.
Lokanath wrote:
hi all
i have a doubt over connection pooling.When 5 users are using a project in
struts and if i have defined the maximumnumber of connection to 4 .Then how
hi all
i have a doubt over connection pooling.When 5 users are using a project in
struts and if i have defined the maximumnumber of connection to 4 .Then how
many connection will be estblished.What i mean to say is how many visible
connection will be there in mysqlprocess
lokanath
Depends on your situation.
If the SQL Exceptions are expected (i.e., a trigger could fail) then
yes, you will want to catch that and send the message back to the user.
However, if you are thinking JDBC is the way to go, you really should
use something like iBATIS that hides this kind of stuff fr
ED]>
> Data: Wed, 07 Apr 2004 09:00:16 -0400
> Para: Struts Users Mailing List <[EMAIL PROTECTED]>
> Assunto: Re: Connection Pooling (How i use...)
>
> So, are there implied catches in there for SQLException (I assume there
> are)?
> In the innermost try block, does t
So, are there implied catches in there for SQLException (I assume there
are)?
In the innermost try block, does the catch rethrow the SQLException so that
it cascades to the outer blocks?
Just trying to understand the model.
Dean Hoover
Larry Meadors wrote:
Yes.
You really might want to consi
List
Emne: Re: Connection Pooling (How i use...)
I use the pool like this: (IS IT WRONG??) I think the connection is
being closed..
try {
Context ctx = new InitialContext();
if (ctx == null)
throw new Exception("Boom - No Context");
Dat
See this
Connection conn = null;
try{
conn = ds.getConnection();
...whatever you wish to do with conn..
catch(SQLException sqle)
{
action of exception
}
finally{
try{
if(nul != conn) conn.close();
}
catch(SQLException sqle){ action of except
Uhh, yeah, I never did that, no, I just heard about it...yeah, that's
it...
;-)
>>> [EMAIL PROTECTED] 04/06/04 11:45 AM >>>
*Quite* right: there was one time we had set the autoCommit on the
connection object to false, forgotten to change it back before releasing
it
to the pool andwell,all
gt;
> Data: Tue, 6 Apr 2004 10:54:06 -0700 (PDT)
> Para: Struts Users Mailing List <[EMAIL PROTECTED]>
> Assunto: Re: Connection Pooling - Monitor
>
> Marcelo,
> The # of connections is determined by the value you
> set when you defined your datasource. What is th
00
> > Para: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> > Assunto: Re: Connection Pooling (How i use...)
> >
> > Now I am closing the connection in the finally
> block.
> > The exemple provided by:
> >
>
http://jakarta.
*Quite* right: there was one time we had set the autoCommit on the
connection object to false, forgotten to change it back before releasing it
to the pool andwell,all I can say is we spent some "interesting" hours
trying to debug that one!
Geeta
Larry Meadors wrote:
> Yes.
>
> So be careful
Oh yeah, that reminds me: Be careful not to double close your
connections - with some implementations, that closes the pool.
So do not close the connectionin the try *and* in the finally - do it
*only* in the finally!
Larry
>>> [EMAIL PROTECTED] 04/06/04 11:25 AM >>>
well, you are right...! Wh
Ah, well, you didn't read the fine print:
-->>Note: this code isn't anywhere near production ready - it's only supposed to be
used as a simple test :-)
Believe me, you should close connections/return them to the pool in a finally block if
you want to avoid major
problems.. As I said before, thi
I have yet to see a *good* example of how to do jdbc on the net.
Most are very simple one-off "throws SQLException" examples that don't
seem to take into consideration little things like stability and
releasing resources. :)
That is why I think tools like iBATIS are so powerful - you get all the
Yes.
So be careful if you tweak the connection (like changing transaction
isolation, etc) because that connection may be used elsewhere, and your
change will persist. :)
Larry
>>> [EMAIL PROTECTED] 04/06/04 11:17 AM >>>
What happens when i do conn.close()? does it go back to the pool?
---
To: Struts Users Mailing List
> Cc:
> Subject: Re: Connection Pooling (How i use...)
>
>
>
> This your problem: closing the connection in your try block. Move it to a
> finally block..
>
> Marcelo Epstein wrote:
>
>
1 - 100 of 118 matches
Mail list logo