Re: Connection Pooling with Struts
Sure I will For time being I used DBCP. Anjib On 12/8/2010 12:54 PM, adam pinder wrote: 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: 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 hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Connection Pooling with Struts
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: 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 hoping someone could suggest me how > to do DB handling efficiently? > > Thanks > Anjib > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org >
RE: Connection Pooling with Struts
careful stan..he has a PhD from an Indian University! Martin __ Man1: in my next life I want to be an attorney from the Middle-East Man1: why do you want to be an attorney from the Middle-East? Man1: so i can work for an American Company > Date: 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 would advise you to > keep the two separated in your mind. Much like you wouldn't look to a > Database connection to serve a web page, neither should you look to 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 > >> 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 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, > >>>>> > >>>>> 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 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, > >>>>>>> spring > >>>>>>> jdbc tempalate, ... . > >>>>>>> google for it and look which framework is the best for your project. > >>>>>>> > >>>>>>> Johannes > >>>>>>> > >>>>>>> > >>>>>>> anjibman wrote: > >>>>>>> > >>>>>>> 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 > >>>>>>>> > >>>>>>>> > >>>>>>>> - > >>>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>>>>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> - > >>>>>>>> > >>>>>>> --- > >>>>>>> web: http://www.jgeppert.com > >>>>>>> twitter: http://twitter.com/jogep > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> - > >>>>>>> > >>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>>>> > >>>>>> > >>>>>> > >>>>>> - > >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>> > >>>> > >>>> > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > >
Re: Connection Pooling with Struts
Then you should be asking on the appropriate list. http://www.catb.org/~esr/faqs/smart-questions.html#forum On Tue, Dec 7, 2010 at 6:15 PM, Anjib wrote: > > Dude > I am asking about ORM tool not Struts framework itself. > > Please see the reply from Johannes. > > Thanks > Anjib > > > On 12/7/2010 5:19 PM, stanl...@gmail.com wrote: > >> 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 would advise you >> to >> keep the two separated in your mind. Much like you wouldn't look to a >> Database connection to serve a web page, neither should you look to >> 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 >>>> 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 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, >>>>>> >>>>>>> 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 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, >>>>>>>>> spring >>>>>>>>> jdbc tempalate, ... . >>>>>>>>> google for it and look which framework is the best for your >>>>>>>>> project. >>>>>>>>> >>>>>>>>> Johannes >>>>>>>>> >>>>>>>>> >>>>>>>>> anjibman wrote: >>>>>>>>> >>>>>>>>> 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 >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> - >>>>>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> - >>>>>>>>>> >>>>>>>>>> --- >>>>>>>>> web: http://www.jgeppert.com >>>>>>>>> twitter: http://twitter.com/jogep >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> - >>>>>>>>> >>>>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> - >>>>>>>> >>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>> >>>>>> >>>>>> >>>>>> - >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >>> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Connection Pooling with Struts
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
Re: Connection Pooling with Struts
Dude I am asking about ORM tool not Struts framework itself. Please see the reply from Johannes. Thanks Anjib On 12/7/2010 5:19 PM, stanl...@gmail.com wrote: 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 would advise you to keep the two separated in your mind. Much like you wouldn't look to a Database connection to serve a web page, neither should you look to 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 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 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, 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 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, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
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 would advise you to keep the two separated in your mind. Much like you wouldn't look to a Database connection to serve a web page, neither should you look to 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 >> 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 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, >>>>> >>>>> 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 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, >>>>>>> spring >>>>>>> jdbc tempalate, ... . >>>>>>> google for it and look which framework is the best for your project. >>>>>>> >>>>>>> Johannes >>>>>>> >>>>>>> >>>>>>> anjibman wrote: >>>>>>> >>>>>>> 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 >>>>>>>> >>>>>>>> >>>>>>>> - >>>>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> - >>>>>>>> >>>>>>> --- >>>>>>> web: http://www.jgeppert.com >>>>>>> twitter: http://twitter.com/jogep >>>>>>> >>>>>>> >>>>>>> >>>>>>> - >>>>>>> >>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>>> >>>>>> >>>>>> >>>>>> - >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>> For additional commands, e-mail: user-h...@struts.apache.org >>>> >>>> >>>> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Connection Pooling with Struts
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 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, 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 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, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
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 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, > >> > >> 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 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, > >>>> spring > >>>> jdbc tempalate, ... . > >>>> google for it and look which framework is the best for your project. > >>>> > >>>> Johannes > >>>> > >>>> > >>>> anjibman wrote: > >>>> > >>>> 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 > >>>>> > >>>>> - > >>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>>>> For additional commands, e-mail: user-h...@struts.apache.org > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> - > >>>> --- > >>>> web: http://www.jgeppert.com > >>>> twitter: http://twitter.com/jogep > >>>> > >>>> > >>>> - > >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>> For additional commands, e-mail: user-h...@struts.apache.org > >>> > >>> > >>> > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > >
Re: Connection Pooling with Struts
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 handle connection pooling beside JDBC > itself? > > Anjib > > > On 12/7/2010 4:20 PM, Arthur Neves wrote: > >> 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 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, >>>> spring >>>> jdbc tempalate, ... . >>>> google for it and look which framework is the best for your project. >>>> >>>> Johannes >>>> >>>> >>>> anjibman wrote: >>>> >>>> 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 >>>>> >>>>> - >>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>>> For additional commands, e-mail: user-h...@struts.apache.org >>>>> >>>>> >>>>> >>>>> >>>>> - >>>> --- >>>> web: http://www.jgeppert.com >>>> twitter: http://twitter.com/jogep >>>> >>>> >>>> - >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >>> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Connection Pooling with Struts
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, 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 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, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
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 > 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 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, > >> spring > >> jdbc tempalate, ... . > >> google for it and look which framework is the best for your project. > >> > >> Johannes > >> > >> > >> anjibman wrote: > >> > >>> 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 > >>> > >>> - > >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >>> For additional commands, e-mail: user-h...@struts.apache.org > >>> > >>> > >>> > >>> > >> - > >> --- > >> web: http://www.jgeppert.com > >> twitter: http://twitter.com/jogep > >> > >> > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > >
Re: Connection Pooling with Struts
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 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, >> spring >> jdbc tempalate, ... . >> google for it and look which framework is the best for your project. >> >> Johannes >> >> >> anjibman wrote: >> >>> 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 >>> >>> - >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >>> >>> >> - >> --- >> web: http://www.jgeppert.com >> twitter: http://twitter.com/jogep >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Connection Pooling with Struts
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, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - --- web: http://www.jgeppert.com twitter: http://twitter.com/jogep - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Connection Pooling with Struts
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, spring jdbc tempalate, ... . google for it and look which framework is the best for your project. Johannes anjibman wrote: > > 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 > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > - --- web: http://www.jgeppert.com twitter: 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: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
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 hoping someone could suggest me how to do DB handling efficiently? Thanks Anjib - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 & Database Connection Pooling
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 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 > servlet api or would I be better off creating an independant connection pool > and injecting it through Spring? > > Regards > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2 & Database Connection Pooling
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 servlet api or would I be better off creating an independant connection pool and injecting it through Spring? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
--- 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: java.lang.NoClassDefFoundError: > org/springframework/context/ApplicationContextAware Did you download Spring and include the appropriate jar(s) in your app? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
provided a data-source configuration element because, at the >> time that was added, there was no consistent mechanism for configuring >> data sources that worked across servlet containers. That changed a long >> time ago and Struts first deprecated, and then removed, its support for >> the data-source configuration element. >> >> The preferred way to set up a data source (using a connection pool or >> not) is through JNDI using your servlet container configuration. The >> article Jeromy linked to mentions JNDI and links to more detailed >> documentation for various servlet containers and application servers. >> >> In short: >> >> 1) configure a data source (connection pool) and expose it via JNDI, >> using your servlet container or application server as described in the >> documentation linked from that article; >> >> 2) modify any code you have that uses a data source (connection pool) to >> obtain it from JNDI, using the code in that article >> >> You don't need Struts2 to be able to do this for you, as there are >> standard mechanisms you can use instead. Of course the prior reference >> to Spring is a good one to look into 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-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 how can we configure in its configuration file(struts.xml)?I >>> think >>> only after configuring in the configuration file(for eg., struts.xml in >>> the >>> case of struts2),we can use the connection pool using a java program as >>> it >>> is explained in the link provided by you.So the problem is with how to >>> configure the pool in the struts.xml?I think I am clear...!! >>> >>> Thanks. >>> >>> Jeromy Evans - Blue Sky Minds wrote: >>>> >>>> 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 immediately. Set it >>>> up the same way as your current DataSource >>>> http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html >>>> >>>> Does that help? >>>> >>>> - >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>>> >>> >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15607230.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
dont forget to share the code. Thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
Ok,,thx for the repliesi'll try using JNDI and with spring integration.I have worked using struts2+hibernate,it works fine.. Laurie Harper wrote: > > Struts1 provided a data-source configuration element because, at the > time that was added, there was no consistent mechanism for configuring > data sources that worked across servlet containers. That changed a long > time ago and Struts first deprecated, and then removed, its support for > the data-source configuration element. > > The preferred way to set up a data source (using a connection pool or > not) is through JNDI using your servlet container configuration. The > article Jeromy linked to mentions JNDI and links to more detailed > documentation for various servlet containers and application servers. > > In short: > > 1) configure a data source (connection pool) and expose it via JNDI, > using your servlet container or application server as described in the > documentation linked from that article; > > 2) modify any code you have that uses a data source (connection pool) to > obtain it from JNDI, using the code in that article > > You don't need Struts2 to be able to do this for you, as there are > standard mechanisms you can use instead. Of course the prior reference > to Spring is a good one to look into 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-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 how can we configure in its configuration file(struts.xml)?I >> think >> only after configuring in the configuration file(for eg., struts.xml in >> the >> case of struts2),we can use the connection pool using a java program as >> it >> is explained in the link provided by you.So the problem is with how to >> configure the pool in the struts.xml?I think I am clear...!! >> >> Thanks. >> >> Jeromy Evans - Blue Sky Minds wrote: >>> >>> 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 immediately. Set it >>> up the same way as your current DataSource >>> http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html >>> >>> Does that help? >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15587014.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
> 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 PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
Struts1 provided a data-source configuration element because, at the time that was added, there was no consistent mechanism for configuring data sources that worked across servlet containers. That changed a long time ago and Struts first deprecated, and then removed, its support for the data-source configuration element. The preferred way to set up a data source (using a connection pool or not) is through JNDI using your servlet container configuration. The article Jeromy linked to mentions JNDI and links to more detailed documentation for various servlet containers and application servers. In short: 1) configure a data source (connection pool) and expose it via JNDI, using your servlet container or application server as described in the documentation linked from that article; 2) modify any code you have that uses a data source (connection pool) to obtain it from JNDI, using the code in that article You don't need Struts2 to be able to do this for you, as there are standard mechanisms you can use instead. Of course the prior reference to Spring is a good one to look into 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-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 how can we configure in its configuration file(struts.xml)?I think only after configuring in the configuration file(for eg., struts.xml in the case of struts2),we can use the connection pool using a java program as it is explained in the link provided by you.So the problem is with how to configure the pool in the struts.xml?I think I am clear...!! Thanks. Jeromy Evans - Blue Sky Minds wrote: 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 immediately. Set it up the same way as your current DataSource http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html Does that help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
Right. The configuration file the mysql reference refers to is the Container configuration, for example, server.xml or context.xml provided with Tomcat. Every J2EE container provides that configuration. Struts 1 provides some config to simply it, but Struts 2 doesn't provide convenience config like that. Setup your DataSource for the Container, then reference it in web.xml. eg. http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html The only issue for Struts2 users is how you access the DataSource within your actions or services. If you use Spring it's easy via DI. If you Guice it's also easy via DI. If you don't use a DI container you can look-up the DataSource every time you need it, or place the instance in your Application Context, as you'd do with a servlet. Hope that helps. 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 has a tag called and there we can configure.But,what about struts2 how can we configure in its configuration file(struts.xml)?I think only after configuring in the configuration file(for eg., struts.xml in the case of struts2),we can use the connection pool using a java program as it is explained in the link provided by you.So the problem is with how to configure the pool in the struts.xml?I think I am clear...!! Thanks. Jeromy Evans - Blue Sky Minds wrote: 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 immediately. Set it up the same way as your current DataSource http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html Does that help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
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,what about struts2 how can we configure in its configuration file(struts.xml)?I think only after configuring in the configuration file(for eg., struts.xml in the case of struts2),we can use the connection pool using a java program as it is explained in the link provided by you.So the problem is with how to configure the pool in the struts.xml?I think I am clear...!! Thanks. Jeromy Evans - Blue Sky Minds wrote: > > > 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 immediately. Set it > up the same way as your current DataSource > http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html > > Does that help? > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15586542.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
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 immediately. Set it up the same way as your current DataSource http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html Does that help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
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 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 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 to connect >> to >> MySQL database,how to implement connection pooling in struts.xml for >> mysql >> database? >> >> Please reply as soon as possible. >> >> Thanks. >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15586219.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 connection pooling using MySQL
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 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 to connect to MySQL database,how to implement connection pooling in struts.xml for mysql database? Please reply as soon as possible. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 connection pooling using MySQL
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 to connect to MySQL database,how to implement connection pooling in struts.xml for mysql database? Please reply as soon as possible. Thanks. -- View this message in context: http://www.nabble.com/Struts2-connection-pooling-using-MySQL-tp15584715p15584715.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling How To ?
-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 this was the load client specified ... i had set the max limit of > my pool to 100 ... that may be the problem . i will go and increase it > now... If you need to serve 200 requests per second, ten you need to evaluate what percentage of requests result in DB connection use, and then estimate the number of those that are simple SELECTs versus more complex queries. I'll bet that many of your requests use connections for a very short amount of time, while others take more time. You need to either estimate or observe that pattern (and you can only estimate right now, since you're only in the dev phase) and then plan the size of your connection pool based upon that. This is crude capacity planning. If each connection lasts 1 second (a long time) and uses a DB connection through the entire request-response cycle, then you'll need exactly 200 connections in your connection pool (plus a few extra for good measure). 200 connections to your database might get very heavy, especially for Oracle (which at least /used/ to be known for very very heavy server-side connection memory requirements -- the db server, not the app server). Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGVDV19CaO5/Lv0PARAkEPAJ9UlPFD76jlZcTwEUr4Hf4jQXQj0gCfUzM3 ZE3Nb1DdqEh44WPc5l4EoZ8= =60Zz -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling How To ?
Hi Christropher .. Yes this is peek load actualy .. 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 this was the load client specified ... i had set the max limit of my pool to 100 ... that may be the problem . i wud go and increase it now... Thanx Christopher Schultz-2 wrote: > > -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 hit with >> 200 request/second The pool gets [exhausted]. > > 200 requests per second is a /lot/ of traffic (8 million requests per > month, if that load is sustained). Is this a peak load, or a steady load? > > Does your pool become permanently exhausted? Or, do you have some users > who get exceptions (cannot get connection after timeout) and others who > get through. If the load drops off, is your pool still exhausted? If > that's the case, then you have a connection leak in your application. > > With heavy load, usually individual requests fail, but the server is > still healthy. You might run out of memory, but you can avoid that by > configuring your server to accept only a certain number of requests and > refusing the rest. > > How long is your connection pool timeout (the amount of time a thread > will wait for a connection before giving up). Perhaps you have to > increase that timeout. You could also increase the number of connections > in your pool. How many do you have in there, now? > > The last option is to buy more hardware. If you really are getting 200 > requests/sec, then you probably need some more hardware for your > application. > >> i am unable to decide which approach i should be using as my application >> can receive large no. of requests around 1000/sec ? > > Geez... I hope that's /peak/ load. Do you have to handle 1000 > requests/sec or 1000 simultaneous users? > > - -chris > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.7 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGUv4G9CaO5/Lv0PARAvZNAJ9+S6+Oyl5cEyFoxkgCmijHkJBJXgCgrzhP > lSigTUYwfyzbIkiEfBLT3Qw= > =ncCh > -END PGP SIGNATURE- > > --------- > 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]
Re: Connection Pooling How To ?
-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 hit with > 200 request/second The pool gets [exhausted]. 200 requests per second is a /lot/ of traffic (8 million requests per month, if that load is sustained). Is this a peak load, or a steady load? Does your pool become permanently exhausted? Or, do you have some users who get exceptions (cannot get connection after timeout) and others who get through. If the load drops off, is your pool still exhausted? If that's the case, then you have a connection leak in your application. With heavy load, usually individual requests fail, but the server is still healthy. You might run out of memory, but you can avoid that by configuring your server to accept only a certain number of requests and refusing the rest. How long is your connection pool timeout (the amount of time a thread will wait for a connection before giving up). Perhaps you have to increase that timeout. You could also increase the number of connections in your pool. How many do you have in there, now? The last option is to buy more hardware. If you really are getting 200 requests/sec, then you probably need some more hardware for your application. > i am unable to decide which approach i should be using as my application > can receive large no. of requests around 1000/sec ? Geez... I hope that's /peak/ load. Do you have to handle 1000 requests/sec or 1000 simultaneous users? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUv4G9CaO5/Lv0PARAvZNAJ9+S6+Oyl5cEyFoxkgCmijHkJBJXgCgrzhP lSigTUYwfyzbIkiEfBLT3Qw= =ncCh -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection Pooling How To ?
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://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96654/connpoca.htm 2. Configuring Jboss's Internal Container Level Connection pooling simply creating the datasources 3. JDBC level Connection Pooling but unluckily did not succeed in any of these method . The application works OK with Second method but When it is being hit with 200 request/second The pool gets exhaulsted . i am unable to decide which approach i should be using as my application can receive large no. of requests around 1000/sec ? Please help me out , Tell some useful link if possible .. Regards , Jasdeep -- View this message in context: http://www.nabble.com/Connection-Pooling--How-To---tf3796605.html#a10738742 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Connection Pooling
-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 JNDI resource that is available to all webapps in your container. You probably only want it available to the webapp you are currently using. >type="javax.sql.DataSource" removeAbandoned="true" > removeAbandonedTimeout="30" maxActive="100" > maxIdle="30" maxWait="1" username="balazs" > password="12345" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/akr_db"/> You should move this to your context.xml file, and remove the element from context.xml. Otherwise, keep these settings the same. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUusQ9CaO5/Lv0PARAmJlAKCMtg85QGBNtRsrKaBPcFoHeLxBlwCeL838 8cEGAm1lmvNQ6JidL65h5Cg= =1LZQ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Connection Pooling
-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 all the values you are currently using for these settings look good. I'm not sure what the problem might be, but this configuration is /way/ easier to read. Perhaps is no longer used in TC 5.5... I used to use it in 4.1.x (with this configuration in server.xml), but when I upgraded, I started using this shorter syntax in the webapp's context.xml. The error message "Cannot create JDBC driver of class '' for connect URL 'null'" usually just means you are missing some tiny piece of configuration (or you have one tiny thing wrong). The devil is in the details... Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUun79CaO5/Lv0PARAudkAJ9eQ9fxkuDJp+hF448KDpwPQJTzgACgnRWb 2SwXA4Jm75edJg28Nq5z/AE= =59qq -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Connection Pooling
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 your $CATALINA_HOME/common/lib directory along with the all the required jars (commons-dbcp, commons-pool, commons-collection) 2) open your server.xml and put the following lines between tags (this is what I missed...) (Modify it properly...) 3) Create a context.xml file in your META-INF directory with the following contents: (Modify it properly...) 4) Create a Java class with the following contents to get a connection from the pool: public class DBTest { String foo = "Not Connected"; String bar = "Empty"; public void init() { Connection conn = null; Statement stmt = null; // Or PreparedStatement if needed ResultSet rst = null; try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("Boom - No Context"); Context envCtx = (Context) ctx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); if (ds != null) { conn = ds.getConnection(); if(conn != null) { foo = "Got Connection "+conn.toString(); stmt = conn.createStatement(); rst = stmt.executeQuery( "select ID_paciens, vezeteknev, keresztnev from torzs_paciens"); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } stmt.close(); stmt = null; conn.close(); conn = null; rst.close(); rst = null; } } }catch(Exception e) { e.printStackTrace(); } finally { // Always make sure result sets and statements are closed, // and the connection is returned to the pool if (rst != null) { try { rst.close(); } catch (SQLException e) { ; } rst = null; } if (stmt != null) { try { stmt.close(); } catch (SQLException e) { ; } stmt = null; } if (conn != null) { try { conn.close(); } catch (SQLException e) { ; } conn = null; } } } public String getFoo() { return foo; } public String getBar() { return bar;} } 5) Use the class from your JSP: <% db_helpers.DBTest tst = new db_helpers.DBTest(); tst.init(); %> Results Foo <%= tst.getFoo() %> Bar <%= tst.getBar() %> -- - Original Message From: Nuwan Chandrasoma <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Tuesday, May 22, 2007 3:38:54 PM Subject: Re: [OT] Connection Pooling Hi, Sorry mate, i think you should ask this from another group like tomcat.., hope this link would give you some help http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html Thanks, Nuwan - Original Message - From: "Balazs Michnay" <[EMAIL PROTECTED]> 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 >Container > > > But still nothing :( > > Thanks, > > BM > > > - 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:3306 > > but should be like: jdbc:mysql://localhost:3306/akr_db > > Thanks, > > Nuwan > > > > > - Original Message - > From: "Balazs Michnay" <[EMAIL PROTECTED]> > To: "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 M
RE: Connection Pooling in Struts
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 it now. All applications can share it and change is at one place. No need to change anything related to DB connection in your application when upgrading to new version of struts / or moving to Different MVC framework (spring)... Regards Guru -Original Message- From: Saravanan Vijayappan [mailto:[EMAIL PROTECTED] Sent: 22 May 2007 10:18 To: struts user Subject: Connection Pooling in Struts 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 9448833571. Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection Pooling in Struts
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 9448833571. Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433
Re: [OT] Connection Pooling
Hi, Sorry mate, i think you should ask this from another group like tomcat.., hope this link would give you some help http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html Thanks, Nuwan - Original Message - From: "Balazs Michnay" <[EMAIL PROTECTED]> 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 Container But still nothing :( Thanks, BM - 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:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: "Balazs Michnay" <[EMAIL PROTECTED]> To: "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 connect to is called "akr_db" and the name of my web-application is called "SZTGKR". 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML factory org.apache.commons.dbcp.BasicDataSourceFactory removeAbandoned true removeAbandonedTimeout 60 logAbandoned true maxActive 100 maxIdle 30 maxWait 1 username balazs password 12345 driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost:3306 -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = "Not Connected"; String bar = "Empty"; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("Boom - No Context"); Context envCtx = (Context) ctx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = "Got Connection "+conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( "select ID_paciens, vezeteknev, keresztnev from torzs_paciens"); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return bar;} } - END OF DBTEST.JAVA Here, my Connection conn = ds.getConnection(); statement fails. And finally I have 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() %> ... -- END OF DBTEST.JSP Do I have anything else to connect to my db using connection pooling? So again, it's the "Connection conn = ds.getConnection();", where my program fails, it says "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" And yes, after the following statement, the url, driverclass and some other properties of my ds is null: DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); This might be the problem... why is that? Thanks for helping again!! Regards, BM - Original Message From: Christopher Schultz <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Monday, May 21, 2007 2:33:11 PM Subject: Re: [OT] Connection Pooling -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Balazs, Balazs Michnay wrote: I still cannot estabilish database connection using connectio
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 Container But still nothing :( Thanks, BM - 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:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: "Balazs Michnay" <[EMAIL PROTECTED]> To: "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 connect to is called "akr_db" > and the name of my web-application is called "SZTGKR". > > 1) I have a context.xml file in my web/Meta-INF directory with the > following contents: > > - CONTEXT.XML > > > reloadable="true"> > prefix="localhost_akr_db_log." suffix=".txt" timestamp="true"/> > type="javax.sql.DataSource"/> > > > factory > org.apache.commons.dbcp.BasicDataSourceFactory > > > removeAbandoned > true > > > removeAbandonedTimeout > 60 > > > logAbandoned > true > > > > maxActive > 100 > > > > maxIdle > 30 > > > > maxWait > 1 > > > > username > balazs > > > password > 12345 > > > > driverClassName > com.mysql.jdbc.Driver > > > > url > jdbc:mysql://localhost:3306 > > > > -END OF CONTEXT.XML > > I have a java class, that (presumably) creates (or returns...?) my > connection pool: > > - DBTEST.JAVA > > package db_helpers; > > import javax.naming.*; > import javax.sql.*; > import java.sql.*; > > public class DBTest { > >String foo = "Not Connected"; >String bar = "Empty"; > >public void init() { >try{ > >Context ctx = new InitialContext(); >if(ctx == null ) >throw new Exception("Boom - No Context"); > >Context envCtx = (Context) ctx.lookup("java:comp/env"); >DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); > >if (ds != null) { >Connection conn = ds.getConnection(); > >if(conn != null) { >foo = "Got Connection "+conn.toString(); >Statement stmt = conn.createStatement(); >ResultSet rst = >stmt.executeQuery( >"select ID_paciens, vezeteknev, keresztnev from > torzs_paciens"); >if(rst.next()) { >foo=rst.getString(2); >bar=rst.getString(3); >} >conn.close(); >} >} >}catch(Exception e) { >e.printStackTrace(); >} >} > >public String getFoo() { return foo; } >public String getBar() { return bar;} > } > > - END OF DBTEST.JAVA > > Here, my > > Connection conn = ds.getConnection(); > > statement fails. > > And finally I have 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() %> > ... > -- END OF DBTEST.JSP > > Do I have anything else to connect to my db using connection pooling? > So again, it's the "Connection conn = ds.getConnection();", where my > program fails, it says > "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver > of class '' for connect URL 'null'" > > And yes, after the following statement, the url, driverclass and some > other properties of my ds i
Re: [OT] Connection Pooling
Still the same error message and the same symptoms: the url and the driverclass properties are still null: :-(( "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" ohhh... what am I missing ??!! - 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:3306 but should be like: jdbc:mysql://localhost:3306/akr_db Thanks, Nuwan - Original Message - From: "Balazs Michnay" <[EMAIL PROTECTED]> To: "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 connect to is called "akr_db" > and the name of my web-application is called "SZTGKR". > > 1) I have a context.xml file in my web/Meta-INF directory with the > following contents: > > - CONTEXT.XML > > > reloadable="true"> > prefix="localhost_akr_db_log." suffix=".txt" timestamp="true"/> > type="javax.sql.DataSource"/> > > > factory > org.apache.commons.dbcp.BasicDataSourceFactory > > > removeAbandoned > true > > > removeAbandonedTimeout > 60 > > > logAbandoned > true > > > > maxActive > 100 > > > > maxIdle > 30 > > > > maxWait > 1 > > > > username > balazs > > > password > 12345 > > > > driverClassName > com.mysql.jdbc.Driver > > > > url > jdbc:mysql://localhost:3306 > > > > -END OF CONTEXT.XML > > I have a java class, that (presumably) creates (or returns...?) my > connection pool: > > - DBTEST.JAVA > > package db_helpers; > > import javax.naming.*; > import javax.sql.*; > import java.sql.*; > > public class DBTest { > >String foo = "Not Connected"; >String bar = "Empty"; > >public void init() { >try{ > >Context ctx = new InitialContext(); >if(ctx == null ) >throw new Exception("Boom - No Context"); > >Context envCtx = (Context) ctx.lookup("java:comp/env"); >DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); > >if (ds != null) { >Connection conn = ds.getConnection(); > >if(conn != null) { >foo = "Got Connection "+conn.toString(); >Statement stmt = conn.createStatement(); >ResultSet rst = >stmt.executeQuery( >"select ID_paciens, vezeteknev, keresztnev from > torzs_paciens"); >if(rst.next()) { >foo=rst.getString(2); >bar=rst.getString(3); >} >conn.close(); >} >} >}catch(Exception e) { >e.printStackTrace(); >} >} > >public String getFoo() { return foo; } >public String getBar() { return bar;} > } > > - END OF DBTEST.JAVA > > Here, my > > Connection conn = ds.getConnection(); > > statement fails. > > And finally I have 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() %> > ... > -- END OF DBTEST.JSP > > Do I have anything else to connect to my db using connection pooling? > So again, it's the "Connection conn = ds.getConnection();", where my > program fails, it says > "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver > of class '' for connect URL 'null'" > > And yes, after the following statem
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 Thanks, Nuwan - Original Message - From: "Balazs Michnay" <[EMAIL PROTECTED]> To: "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 connect to is called "akr_db" and the name of my web-application is called "SZTGKR". 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML reloadable="true"> prefix="localhost_akr_db_log." suffix=".txt" timestamp="true"/> type="javax.sql.DataSource"/> factory org.apache.commons.dbcp.BasicDataSourceFactory removeAbandoned true removeAbandonedTimeout 60 logAbandoned true maxActive 100 maxIdle 30 maxWait 1 username balazs password 12345 driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost:3306 -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = "Not Connected"; String bar = "Empty"; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("Boom - No Context"); Context envCtx = (Context) ctx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = "Got Connection "+conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( "select ID_paciens, vezeteknev, keresztnev from torzs_paciens"); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return bar;} } - END OF DBTEST.JAVA Here, my Connection conn = ds.getConnection(); statement fails. And finally I have 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() %> ... -- END OF DBTEST.JSP Do I have anything else to connect to my db using connection pooling? So again, it's the "Connection conn = ds.getConnection();", where my program fails, it says "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" And yes, after the following statement, the url, driverclass and some other properties of my ds is null: DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); This might be the problem... why is that? Thanks for helping again!! Regards, BM - Original Message From: Christopher Schultz <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Monday, May 21, 2007 2:33:11 PM Subject: Re: [OT] Connection Pooling -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 settings you are using? You only showed the code (which looked fine, except that you don't need to check for null after you create a new InitialContext... I'm pretty sure that an object creation can't return null). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUZGG9CaO5/Lv0PARAm8OAJ0cXJTmHSXhX8prghRHixkEbU89KACeL71M LYCgqlaLzn1mIzUZsGo9c8A= =aJtP -END PGP SIGNATURE- -
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 connect to is called "akr_db" and the name of my web-application is called "SZTGKR". 1) I have a context.xml file in my web/Meta-INF directory with the following contents: - CONTEXT.XML factory org.apache.commons.dbcp.BasicDataSourceFactory removeAbandoned true removeAbandonedTimeout 60 logAbandoned true maxActive 100 maxIdle 30 maxWait 1 username balazs password 12345 driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost:3306 -END OF CONTEXT.XML I have a java class, that (presumably) creates (or returns...?) my connection pool: - DBTEST.JAVA package db_helpers; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = "Not Connected"; String bar = "Empty"; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception("Boom - No Context"); Context envCtx = (Context) ctx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = "Got Connection "+conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( "select ID_paciens, vezeteknev, keresztnev from torzs_paciens"); if(rst.next()) { foo=rst.getString(2); bar=rst.getString(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public String getBar() { return bar;} } - END OF DBTEST.JAVA Here, my Connection conn = ds.getConnection(); statement fails. And finally I have 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() %> ... -- END OF DBTEST.JSP Do I have anything else to connect to my db using connection pooling? So again, it's the "Connection conn = ds.getConnection();", where my program fails, it says "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" And yes, after the following statement, the url, driverclass and some other properties of my ds is null: DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); This might be the problem... why is that? Thanks for helping again!! Regards, BM - Original Message From: Christopher Schultz <[EMAIL PROTECTED]> To: Struts Users Mailing List Sent: Monday, May 21, 2007 2:33:11 PM Subject: Re: [OT] Connection Pooling -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 settings you are using? You only showed the code (which looked fine, except that you don't need to check for null after you create a new InitialContext... I'm pretty sure that an object creation can't return null). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUZGG9CaO5/Lv0PARAm8OAJ0cXJTmHSXhX8prghRHixkEbU89KACeL71M LYCgqlaLzn1mIzUZsGo9c8A= =aJtP -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/
Re: [OT] Connection Pooling
-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 settings you are using? You only showed the code (which looked fine, except that you don't need to check for null after you create a new InitialContext... I'm pretty sure that an object creation can't return null). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGUZGG9CaO5/Lv0PARAm8OAJ0cXJTmHSXhX8prghRHixkEbU89KACeL71M LYCgqlaLzn1mIzUZsGo9c8A= =aJtP -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection Pooling
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 in my server.xml 2) I used the following source code to connect: 1.Context ctx = new InitialContext(); 2.if(ctx == null ) throw new Exception("No Context"); 3. 4.Context envCtx = (Context) ctx.lookup("java:comp/env"); 5.DataSource ds = (DataSource) envCtx.lookup("jdbc/akr_db"); 6. 7.if (ds != null) { 8.Connection conn = ds.getConnection(); 9. 10.if(conn != null) { . . . I can get the datasource (5th line), but I cannot get connection (8th line). It exits with the following error message, however, I have set both the driver class name and url in my server.xml: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" Any ideas what's next? Thanks a lot, BM Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. http://answers.yahoo.com/dir/?link=list&sid=396545367
Re: (HELP) Struts - Oracle Database Connectivity Using DBCP connection Pooling
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 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 class to acess the datasource I have been trying for long time , but i cant get any working solution help me out Thanks in advance Mohan - Yahoo! FareChase - Search multiple travel sites in one click. - Yahoo! FareChase - Search multiple travel sites in one click.
Re: (HELP) Struts - Oracle Database Connectivity Using DBCP connection Pooling
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 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 class to acess the datasource > > I have been trying for long time , but i cant get any working solution > > help me out > > Thanks in advance > Mohan > > > > - > Yahoo! FareChase - Search multiple travel sites in one click. > -- Yujun Liang [EMAIL PROTECTED]
Re: (HELP) Struts - Oracle Database Connectivity Using DBCP connection Pooling
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 > > > 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 class to acess the datasource > > I have been trying for long time , but i cant get any working solution > > help me out > > Thanks in advance > Mohan > > > > - > Yahoo! FareChase - Search multiple travel sites in one click. FOCUS Computing - web design Mob: 0415 24 26 24 [EMAIL PROTECTED] http://www.focus-computing.com.au -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.12.8/163 - Release Date: 8/11/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(HELP) Struts - Oracle Database Connectivity Using DBCP connection Pooling
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 class to acess the datasource I have been trying for long time , but i cant get any working solution help me out Thanks in advance Mohan - Yahoo! FareChase - Search multiple travel sites in one click.
Re: Connection Pooling With Struts
Tomcat can provide a connection pool, you just have to configure the pool and look up the resource in your application. The details can be found here : http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html Tushar Agrawal wrote: 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 - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Connection Pooling With Struts
Hibernate (it has a Struts plugIn) can set those up automatically for you and connect to both using the same API. http://www.hibernate.org Regards, David -Original Message- From: Tushar Agrawal [mailto:[EMAIL PROTECTED] Sent: Thursday, November 04, 2004 11:08 PM To: Struts Mailing List 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. Thanks Tushar Agrawal - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com/a - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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. Thanks Tushar Agrawal - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com/a
RE: Connection pooling problem
I have 4 excellent questions for you, of which #1 could be of EXTREME importance to you... 1. Have you changed your password YET since you posted all of your JDBC oracle details in the below message? 2. Have you logged into your Oracle database on the host chd4.sbc.com and verified that the connection pool is logged in and working under the username "scott" ? 3. Are you sure you are calling it correctly from line 49, the execute method of the Action class CalculationsReportAction (As listed below in your included error messages) ? I see the com.sbc.ssbilling.database..etc. (line 63) has trouble with what it was given so perhaps you're setting something up incorrectly. 4. Have you logged or echo printed our the JDNI resource jdbc.myoracle exists and then logged/echo-printed the class using, say... object.getClass() ? Regards, David -Original Message- 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 modifications to my server.xml file. > > > > > > > > > > > >className="org.apache.catalina.mbeans.ServerLifecycleListener" > debug="0"/> >className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener > " > debug="0"/> > > > > > > value="30"/> > > >type="org.apache.catalina.UserDatabase" >description="User database that can be updated and saved"> > > > > factory > > org.apache.catalina.users.MemoryUserDatabaseFactory > > > pathname > conf/tomcat-users.xml > > > > > type="javax.sql.DataSource"/> > > > > factory > > org.apache.commons.dbcp.BasicDataSourceFactory > > > driverClassName > oracle.jdbc.driver.OracleDriver > > > url > > > > jdbc:oracle:thin:@chd4.sbc.com:1521:ostl411 > > > username > scott > > > password > tiger > > > maxActive > 20 > > > maxIdle > 10 > > > maxWait > -1 > > > > > > > > > > > > > > > maxThreads="150" minSpareThreads="25" > maxSpareThreads="75" >enableLookups="false" redirectPort="8443" > acceptCount="100" >debug="0" connectionTimeout="2" >disableUploadTimeout="true" /> > > > > > > > > > enableLookups="false" redirectPort="8443" debug="0" >protocol="AJP/1.3" /> > > > > > > > > > > > > > > > > > prefix="catalina_log." suffix=".txt" > timestamp="true"/> > > > > > debug="0" resourceName="UserDatabase"/> > > > > > > > > > > > > > > unpackWARs="true" autoDeploy="true" >xmlValidation="false" xmlNamespaceAware="false"> > > > > > > > > > > > > > > > > directory="logs" prefix="localhost_log." > suffix=".txt" > timestamp="true"/> > > > > > > > > > > But whenever I try to access the database I get the following error. > > > org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver > of class '' for connect URL 'null' > at > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSour > ce.java:780) > at > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource. > java:540
Connection pooling problem
> 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.ServerLifecycleListener" > debug="0"/> >className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener > " > debug="0"/> > > > > > > value="30"/> > > >type="org.apache.catalina.UserDatabase" >description="User database that can be updated and saved"> > > > > factory > > org.apache.catalina.users.MemoryUserDatabaseFactory > > > pathname > conf/tomcat-users.xml > > > > > type="javax.sql.DataSource"/> > > > > factory > > org.apache.commons.dbcp.BasicDataSourceFactory > > > driverClassName > oracle.jdbc.driver.OracleDriver > > > url > > > > jdbc:oracle:thin:@chd4.sbc.com:1521:ostl411 > > > username > scott > > > password > tiger > > > maxActive > 20 > > > maxIdle > 10 > > > maxWait > -1 > > > > > > > > > > > > > > > maxThreads="150" minSpareThreads="25" > maxSpareThreads="75" >enableLookups="false" redirectPort="8443" > acceptCount="100" >debug="0" connectionTimeout="2" >disableUploadTimeout="true" /> > > > > > > > > > enableLookups="false" redirectPort="8443" debug="0" >protocol="AJP/1.3" /> > > > > > > > > > > > > > > > > > prefix="catalina_log." suffix=".txt" > timestamp="true"/> > > > > > debug="0" resourceName="UserDatabase"/> > > > > > > > > > > > > > > unpackWARs="true" autoDeploy="true" >xmlValidation="false" xmlNamespaceAware="false"> > > > > > > > > > > > > > > > > directory="logs" prefix="localhost_log." > suffix=".txt" > timestamp="true"/> > > > > > > > > > > But whenever I try to access the database I get the following error. > > > org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver > of class '' for connect URL 'null' > at > org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSour > ce.java:780) > at > org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource. > java:540) > at > com.sbc.ssbilling.database.DBConnectionImpl.makeDBConnection(DBConnect > ionImpl.java:63) > at > com.sbc.ssbilling.calculation.action.CalculationsReportAction.execute( > CalculationsReportAction.java:49) > at > org.apache.struts.action.RequestProcessor.processActionPerform(Request > Processor.java:484) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.jav > a:274) > at > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482 > ) > at > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli > cationFilterChain.java
RE: connection pooling
> -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 > tomcat's server.xml will it work as per the expectation for abandoned > connection. > > > > > > > > No I don' think so... tomcat is managing the connection not struts. > > > > -Jignesh > On Mon, 2004-08-16 at 18:20, Jim Barrows wrote: > > > -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 > > > 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? > > > > > > > > > > > > > > > > > property="driverClassName" > > > value="org.postgresql.Driver" /> > > > > > property="url" > > > value="jdbc:postgresql://localhost/mydatabase" /> > > > > > property="username" > > > value="me" /> > > > > > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasourc > e-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20 > Configurations > > The short version is that it is handled automagically for > you. No need to borrow or return the connection etc. > > > > > > > . > > > . > > > . > > > .. > > > > > > regards > > > saurabh > > > > > > > > > > > > On Mon, 2004-08-16 at 16:45, Jim Barrows wrote: > > > > > -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 > > > > > wrong I want to call my DAO from my Action class. So > > > > > the snippet > > > > > that you sent me would go in my DAO class in the function > > > > > getConnection() (or something like that). > > > > > > > > Yes, that is correct. I acutally implment that in my > > > DaoFactory class, and put the resultant connection from the > > > data source in the DaoFactory class. That allows me to > > > easily de-couple the dao class for testing. > > > > > > > > > And if what I said is correct then does it mean that I > > > > > dont need to > > > > > have a connection pool class and my webserver would > > > handle everything > > > > > for me. > > > > > > > > Depends on the web server... websphere has it's own, tomcat > > > allows you to have several choices, and I have no idea > what BEA does. > > > > > > > > > > > > > > > > > > regards > > > > > saurabh > > > > > > > > > > On Mon, 2004-08-16 at 16:29, Jim Barrows wrote: > > > > > > > -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 > > > > > > > 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
RE: connection pooling
Suppose I will put following code in my struts-config.xml instead of tomcat's server.xml will it work as per the expectation for abandoned connection. -Jignesh On Mon, 2004-08-16 at 18:20, Jim Barrows wrote: > > -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 > > 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? > > > > > > > > > > > property="driverClassName" > > value="org.postgresql.Driver" /> > > > property="url" > > value="jdbc:postgresql://localhost/mydatabase" /> > > > property="username" > > value="me" /> > > http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations > The short version is that it is handled automagically for you. No need to borrow or > return the connection etc. > > > > . > > . > > . > > .. > > > > regards > > saurabh > > > > > > > > On Mon, 2004-08-16 at 16:45, Jim Barrows wrote: > > > > -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 > > > > wrong I want to call my DAO from my Action class. So > > > > the snippet > > > > that you sent me would go in my DAO class in the function > > > > getConnection() (or something like that). > > > > > > Yes, that is correct. I acutally implment that in my > > DaoFactory class, and put the resultant connection from the > > data source in the DaoFactory class. That allows me to > > easily de-couple the dao class for testing. > > > > > > > And if what I said is correct then does it mean that I > > > > dont need to > > > > have a connection pool class and my webserver would > > handle everything > > > > for me. > > > > > > Depends on the web server... websphere has it's own, tomcat > > allows you to have several choices, and I have no idea what BEA does. > > > > > > > > > > > > > > regards > > > > saurabh > > > > > > > > On Mon, 2004-08-16 at 16:29, Jim Barrows wrote: > > > > > > -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 > > > > > > 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 want to have a connection pool class initialized at > > the time the > > > > > > server starts and then all my DAO should get the > > > > connection from that > > > > > > pool. Is it possible? > > > > > > I am a beginner in this field and I might not understand it > > > > > > completely. please correct me if i am wrong. > > > > > > > > > > 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
RE: connection pooling
> -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 > 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? > > > > >property="driverClassName" > value="org.postgresql.Driver" /> >property="url" > value="jdbc:postgresql://localhost/mydatabase" /> >property="username" > value="me" /> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations The short version is that it is handled automagically for you. No need to borrow or return the connection etc. > . > . > . > .. > > regards > saurabh > > > > On Mon, 2004-08-16 at 16:45, Jim Barrows wrote: > > > -----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 > > > wrong I want to call my DAO from my Action class. So > > > the snippet > > > that you sent me would go in my DAO class in the function > > > getConnection() (or something like that). > > > > Yes, that is correct. I acutally implment that in my > DaoFactory class, and put the resultant connection from the > data source in the DaoFactory class. That allows me to > easily de-couple the dao class for testing. > > > > > And if what I said is correct then does it mean that I > > > dont need to > > > have a connection pool class and my webserver would > handle everything > > > for me. > > > > Depends on the web server... websphere has it's own, tomcat > allows you to have several choices, and I have no idea what BEA does. > > > > > > > > > > regards > > > saurabh > > > > > > On Mon, 2004-08-16 at 16:29, Jim Barrows wrote: > > > > > -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 > > > > > 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 want to have a connection pool class initialized at > the time the > > > > > server starts and then all my DAO should get the > > > connection from that > > > > > pool. Is it possible? > > > > > I am a beginner in this field and I might not understand it > > > > > completely. please correct me if i am wrong. > > > > > > > > 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: > > > > > > > > /** > > > > * > > > > */ > > > > public static DataSource getDataSource() throws > > > NamingException { > > > > if (ds == null) { > > > > Context ctx = (Context) new InitialContext(); > > > > ds = > > > > (DataSource) ctx.lookup( > > > > "jdbc/yourDataSource); > > > > } > > > > return ds; > > > > } > > > > > > > > > regards > > > > > saurabh > > > > > > >
RE: connection pooling
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:45, Jim Barrows wrote: > > -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 > > wrong I want to call my DAO from my Action class. So > > the snippet > > that you sent me would go in my DAO class in the function > > getConnection() (or something like that). > > Yes, that is correct. I acutally implment that in my DaoFactory class, and put the > resultant connection from the data source in the DaoFactory class. That allows me > to easily de-couple the dao class for testing. > > > And if what I said is correct then does it mean that I > > dont need to > > have a connection pool class and my webserver would handle everything > > for me. > > Depends on the web server... websphere has it's own, tomcat allows you to have > several choices, and I have no idea what BEA does. > > > > > > regards > > saurabh > > > > On Mon, 2004-08-16 at 16:29, Jim Barrows wrote: > > > > -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 > > > > 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 want to have a connection pool class initialized at the time the > > > > server starts and then all my DAO should get the > > connection from that > > > > pool. Is it possible? > > > > I am a beginner in this field and I might not understand it > > > > completely. please correct me if i am wrong. > > > > > > 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: > > > > > > /** > > > * > > > */ > > > public static DataSource getDataSource() throws > > NamingException { > > > if (ds == null) { > > > Context ctx = (Context) new InitialContext(); > > > ds = > > > (DataSource) ctx.lookup( > > > "jdbc/yourDataSource); > > > } > > > return ds; > > > } > > > > > > > regards > > > > saurabh > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: connection pooling
Saurabh, If you want to do some kind of initialization when your server starts up, you can implement the org.apache.struts.action.PlugIn interface and override the init() method to do your initialization. Check Logon example application, 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 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 want to have a connection pool class initialized at the time the server starts and then all my DAO should get the connection from that pool. Is it possible? I am a beginner in this field and I might not understand it completely. please correct me if i am wrong. regards saurabh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: connection pooling
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 servers guide > > on how to setup a data source, then you follow the destructions for a > > normal jndi data source. Something like: > > Additionally, Saurabh, have you considered using something like OJB or > Hibernate? > > http://db.apache.org/ojb/ > http://www.hibernate.org/ > > I understand that you have limited experience in this area > (persistence), but these tools can greatly simplify storing and > retrieving objects from a relational database. > > > - Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: connection pooling
> -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 > wrong I want to call my DAO from my Action class. So > the snippet > that you sent me would go in my DAO class in the function > getConnection() (or something like that). Yes, that is correct. I acutally implment that in my DaoFactory class, and put the resultant connection from the data source in the DaoFactory class. That allows me to easily de-couple the dao class for testing. > And if what I said is correct then does it mean that I > dont need to > have a connection pool class and my webserver would handle everything > for me. Depends on the web server... websphere has it's own, tomcat allows you to have several choices, and I have no idea what BEA does. > > regards > saurabh > > On Mon, 2004-08-16 at 16:29, Jim Barrows wrote: > > > -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 > > > 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 want to have a connection pool class initialized at the time the > > > server starts and then all my DAO should get the > connection from that > > > pool. Is it possible? > > > I am a beginner in this field and I might not understand it > > > completely. please correct me if i am wrong. > > > > 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: > > > > /** > > * > > */ > > public static DataSource getDataSource() throws > NamingException { > > if (ds == null) { > > Context ctx = (Context) new InitialContext(); > > ds = > > (DataSource) ctx.lookup( > > "jdbc/yourDataSource); > > } > > return ds; > > } > > > > > regards > > > saurabh > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: connection pooling
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, have you considered using something like OJB or Hibernate? http://db.apache.org/ojb/ http://www.hibernate.org/ I understand that you have limited experience in this area (persistence), but these tools can greatly simplify storing and retrieving objects from a relational database. - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: connection pooling
Jim, I am sorry but I am confused now. Just correct me if I am wrong I want to call my DAO from my Action class. So the snippet that you sent me would go in my DAO class in the function getConnection() (or something like that). And if what I said is correct then does it mean that I dont need to have a connection pool class and my webserver would handle everything for me. regards saurabh On Mon, 2004-08-16 at 16:29, Jim Barrows wrote: > > -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 > > 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 want to have a connection pool class initialized at the time the > > server starts and then all my DAO should get the connection from that > > pool. Is it possible? > > I am a beginner in this field and I might not understand it > > completely. please correct me if i am wrong. > > 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: > > /** > * > */ > public static DataSource getDataSource() throws NamingException { > if (ds == null) { > Context ctx = (Context) new InitialContext(); > ds = > (DataSource) ctx.lookup( > "jdbc/yourDataSource); > } > return ds; > } > > > regards > > saurabh > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: connection pooling
> -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 > 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 want to have a connection pool class initialized at the time the > server starts and then all my DAO should get the connection from that > pool. Is it possible? > I am a beginner in this field and I might not understand it > completely. please correct me if i am wrong. 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: /** * */ public static DataSource getDataSource() throws NamingException { if (ds == null) { Context ctx = (Context) new InitialContext(); ds = (DataSource) ctx.lookup( "jdbc/yourDataSource); } return ds; } > regards > saurabh > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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 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 want to have a connection pool class initialized at the time the server starts and then all my DAO should get the connection from that pool. Is it possible? I am a beginner in this field and I might not understand it completely. please correct me if i am wrong. regards saurabh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: connection pooling
> -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 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-doc/jndi-datasource-examples-howto.html And doing that with struts: http://struts.apache.org/userGuide/configuration.html#data-source_config Alhtough, I would suggest maybe using a DAO layer for convienence later on down the road when things change :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: connection pooling
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://struts.apache.org/faqs/database.html - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: connection pooling
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-doc/jndi-datasource-examples-howto.html - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
connection pooling
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 nothing like an init() method. I have the connection pool class that i have written and i was using in one of my servlets. Now i want to know how to initialize the connection pool object and how to pass that object to all Action classes. Any suggestion would be greatly appreciated. regards saurabh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to disable struts connection pooling logs
They just need to be distributed with the application - in the case of JDeveloper adding them to the project will do this - but if you are manually deploying your app just make sure those two files end up in the /WEB-INF/classes directory - You can even retro-fit them in after you've deployed if needs be. Regards Duncan Mills http://www.groundside.com/blog Veera Sivakumar wrote: Hi Duncan, I have followed your instructions. I have created two properties file exactly how you specified in your article. Then at the end the article says 'Once these properties files are configured and added to your project, the unwanted log messages will be suppressed'. How to add these to the project. Should I update struts-config.xml or web.xml with the new properties file? Can you please elaborate on this. Thanks and regards Shiva -Original Message- From: Duncan Mills [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/products/jdev/tips/mills/Struts-logging.html Regards Duncan Mills http://www.groundside.com/blog Veera Sivakumar wrote: 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 org.apache.struts.legacy.GenericDataSource getConnection INFO: getConnection() Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Check for timeout, activeCount=2, useCount=0 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Found available connection Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Return allocated connection, activeCount=2, useCount=1 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource returnConnection INFO: releaseConnection(), activeCount=2, useCount=0 My log file is getting filled with these entries quickly. I want the above logs not to be written in the log file. I have kept the debug option '0' in server.xml for my app .. Also, I have modified my web.xml for my app to set the debug=0 action org.apache.struts.action.ActionServlet application qca.aps.resources.ApplicationResources config /WEB-INF/struts-config.xml debug 0 detail 0 I am still getting these logs in my log file. Can any one help me what else I have to set to stop these connection pooling entries in log file. Thanks in advance Shiva Visit our website at http://www.rm.com This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information only for the intended purpose. Internet communications are not secure and therefore RM does not accept legal responsibility for the contents of this message. Any views or opinions presented are only those of the author and not those of RM. If this email has come to you in error please delete it and any attachments. Please note that RM may intercept incoming and outgoing e-mail communications. This email has been scanned for viruses by Trend ScanMail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to disable struts connection pooling logs
Hi Duncan, I have followed your instructions. I have created two properties file exactly how you specified in your article. Then at the end the article says 'Once these properties files are configured and added to your project, the unwanted log messages will be suppressed'. How to add these to the project. Should I update struts-config.xml or web.xml with the new properties file? Can you please elaborate on this. Thanks and regards Shiva -Original Message- From: Duncan Mills [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/products/jdev/tips/mills/Struts-logging.html Regards Duncan Mills http://www.groundside.com/blog Veera Sivakumar wrote: >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 org.apache.struts.legacy.GenericDataSource getConnection >INFO: getConnection() >Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection >INFO:Check for timeout, activeCount=2, useCount=0 >Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection >INFO:Found available connection >Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection >INFO:Return allocated connection, activeCount=2, useCount=1 >Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource returnConnection >INFO: releaseConnection(), activeCount=2, useCount=0 > > >My log file is getting filled with these entries quickly. >I want the above logs not to be written in the log file. >I have kept the debug option '0' in server.xml for my app .. > > > >Also, I have modified my web.xml for my app to set the debug=0 > > >action >org.apache.struts.action.ActionServlet > > application > qca.aps.resources.ApplicationResources > > > > config > /WEB-INF/struts-config.xml > > > debug > 0 > > > detail > 0 > > >I am still getting these logs in my log file. Can any one help me what else I have to >set to stop these connection pooling entries in log file. > >Thanks in advance > >Shiva > >Visit our website at http://www.rm.com > >This message is confidential. You should not copy it >or disclose its contents to anyone. You may use and apply the information >only for the intended purpose. Internet communications are not secure and >therefore RM does not accept legal responsibility for the contents of this >message. Any views or opinions presented are only those of the author and >not those of RM. If this email has come to you in error please delete it >and any attachments. Please note that RM may intercept incoming and >outgoing e-mail communications. > >This email has been scanned for viruses by Trend ScanMail. > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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.com/blog Veera Sivakumar wrote: 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 org.apache.struts.legacy.GenericDataSource getConnection INFO: getConnection() Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Check for timeout, activeCount=2, useCount=0 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Found available connection Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Return allocated connection, activeCount=2, useCount=1 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource returnConnection INFO: releaseConnection(), activeCount=2, useCount=0 My log file is getting filled with these entries quickly. I want the above logs not to be written in the log file. I have kept the debug option '0' in server.xml for my app .. Also, I have modified my web.xml for my app to set the debug=0 action org.apache.struts.action.ActionServlet application qca.aps.resources.ApplicationResources config /WEB-INF/struts-config.xml debug 0 detail 0 I am still getting these logs in my log file. Can any one help me what else I have to set to stop these connection pooling entries in log file. Thanks in advance Shiva Visit our website at http://www.rm.com This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information only for the intended purpose. Internet communications are not secure and therefore RM does not accept legal responsibility for the contents of this message. Any views or opinions presented are only those of the author and not those of RM. If this email has come to you in error please delete it and any attachments. Please note that RM may intercept incoming and outgoing e-mail communications. This email has been scanned for viruses by Trend ScanMail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to disable struts connection pooling logs
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 org.apache.struts.legacy.GenericDataSource getConnection INFO: getConnection() Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Check for timeout, activeCount=2, useCount=0 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Found available connection Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource getConnection INFO:Return allocated connection, activeCount=2, useCount=1 Jul 9, 2004 9:13:59 AM org.apache.struts.legacy.GenericDataSource returnConnection INFO: releaseConnection(), activeCount=2, useCount=0 My log file is getting filled with these entries quickly. I want the above logs not to be written in the log file. I have kept the debug option '0' in server.xml for my app .. Also, I have modified my web.xml for my app to set the debug=0 action org.apache.struts.action.ActionServlet application qca.aps.resources.ApplicationResources config /WEB-INF/struts-config.xml debug 0 detail 0 I am still getting these logs in my log file. Can any one help me what else I have to set to stop these connection pooling entries in log file. Thanks in advance Shiva Visit our website at http://www.rm.com This message is confidential. You should not copy it or disclose its contents to anyone. You may use and apply the information only for the intended purpose. Internet communications are not secure and therefore RM does not accept legal responsibility for the contents of this message. Any views or opinions presented are only those of the author and not those of RM. If this email has come to you in error please delete it and any attachments. Please note that RM may intercept incoming and outgoing e-mail communications. This email has been scanned for viruses by Trend ScanMail.
Re: Connection Pooling
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, you wrote: 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 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 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 suggestion Masashi. > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling
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 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 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 suggestion Masashi. > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling
Thanks for the response. I am using the "getConnection(request)" method to get the connection and then "connection.close()" to close the connection. "getConnection()" and "close()" both are in library files provided by struts (DBCP). Therefore it is difficult to put the counter in these methods. Any idea how can we put the counters in these methods? Or there is any way in which if i increase the DEBUG level and investigate the log file generated by Tomcat (catalina.out) Riyad Kalla wrote: > This may seem to simplistic, but you could do a search for whichever > method you call to open a connection and then do a search for > connection.close() (or whatever you named the variable) and see if the > numbers add up... if they don't, this might help you narrow down which > file the two aren't syncronous 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.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. We have actually assumed that the application gets hang due > > to > > this reason only. > > > > Is there any way to DEBUG where in the application where the connection > > is not getting closed. > > > > Regards > > Shailender Jain > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling
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 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 suggestion Masashi. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling
"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 suggestion Masashi. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling
I'm using Oracle and when I meet that situation, i check the DB session (v$session) and operate GUI . When number of DB sessions increase, that is the timing . And Some other guy says the set the max number of connectons to 1. hope this help At 22:49 04/06/08 -0700, you wrote: This may seem to simplistic, but you could do a search for whichever method you call to open a connection and then do a search for connection.close() (or whatever you named the variable) and see if the numbers add up... if they don't, this might help you narrow down which file the two aren't syncronous 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.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. We have actually assumed that the application gets hang due > to > this reason only. > > Is there any way to DEBUG where in the application where the connection > is not getting closed. > > Regards > Shailender Jain > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling
This may seem to simplistic, but you could do a search for whichever method you call to open a connection and then do a search for connection.close() (or whatever you named the variable) and see if the numbers add up... if they don't, this might help you narrow down which file the two aren't syncronous 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.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. We have actually assumed that the application gets hang due > to > this reason only. > > Is there any way to DEBUG where in the application where the connection > is not getting closed. > > Regards > Shailender Jain > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection Pooling
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 very frequently. We have actually assumed that the application gets hang due to this reason only. Is there any way to DEBUG where in the application where the connection is not getting closed. Regards Shailender Jain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: connection pooling
If 5 users are simultaneously using the database connections then you need to create more connections. Brati Sankar Ghosh Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Lokanath <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 05/20/2004 10:11 AM 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 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 -Original Message- From: Struts Users Mailing List [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 4:19 AM To: [EMAIL PROTECTED] Subject: Multiple nested Hashmaps. Limit? I am running into a problem with multiple Mapped nested properties When I use the following lines to access the Value form my dynaValueObj Object I get this error <% String value="dynaTableObj.dynaRowObjs("+rowNm+").dynaValueObjs("+key+").dynaCo lumnValue"; %> [ServletException in:/WEB-INF/src/jsp/dyna/dynaTableData.jsp] Null property value for 'dynaValueObjs(1)'' After tracing I found that it is not calling getDynaValueObjs(String xx) but calling getDynaValueObjs(). Is there a limitation on how many map-backed properties you can reference? Thanks Randy Shelley [EMAIL PROTECTED] -- Dyna Table Form Bean public class DynaTableDataForm extends ActionForm { private DynaTableObj dynaTableObj = null; public DynaTableObj getDynaTableObj () { if (this.dynaTableObj==null) { this.dynaTableObj = new DynaTableObj(); } return this.dynaTableObj; } public void setDynaTableObj (DynaTableObj dynaTableObj) { this.dynaTableObj = dynaTableObj; } } Dyna Table Object public class DynaTableObj { private LinkedHashMap dynaColumnObjs = null; public DynaTableObj() {} public void setDynaColumnObjs(LinkedHashMap dynaColumnObjs) { this.dynaColumnObjs = dynaColumnObjs; } public LinkedHashMap getDynaColumnObjs() { return this.dynaColumnObjs; } public Object getDynaColumnObjs(String dynaColumnId) { if (dynaColumnObjs==null) { this.dynaColumnObjs = new LinkedHashMap(); this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj()); } else if (this.dynaColumnObjs.get(dynaColumnId)==null) { this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj()); } return this.dynaColumnObjs.get(dynaColumnId); } public void setDynaColumnObjs(String dynaColumnId,Object dynaColumnObj) { if (dynaColumnObjs==null) { this.dynaColumnObjs = new LinkedHashMap(); } this.dynaColumnObjs.put(dynaColumnId,dynaColumnObj); } } -- Dyna Row Object public class DynaRowObj { private LinkedHashMap dynaValueObjs = null; public DynaRowObj() {} public void setDynaValueObjs(LinkedHashMap dynaColumnObjs) { this.dynaValueObjs = dynaValueObjs; } public LinkedHashMap getDynaValueObjs() { return this.dynaValueObjs; } public Object getDynaValueObjs(String dynaColumnId) { if (dynaValueObjs==null) { this.dynaValueObjs = new LinkedHashMap(); this.dynaValueObjs.put(dynaColumnId,new DynaValueObj()); } else if (this.dynaValueObjs.get(dynaColumnId)==null) { this.dynaValueObjs.put(dynaColumnId,new DynaColumnObj()); } return this.dynaValueObjs.get(dynaColumnId); } public void setDynaValueObjs(String dynaColumnId,Object dynaValueObj) { if (dynaValueObjs==null) { this.dynaValueObjs = new LinkedHashMap(); } this.dynaValueObjs.put(dynaColumnId,dynaValueObj); } } - Dyna Value Object package rshelley.timesheet.util; public class DynaValueObj { private String dynaColumnValue = null; public DynaValueObj() { } public void setDynaColumnValue(String dynaColumnValue) { this.dynaColumnValue = dynaColumnValue; } public String getDynaColumnValue() { return this.dynaColumnValue; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ForwardSourceID:NT9596 DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services. It mu
Re: connection pooling
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 many connection will be estblished.What i mean to say is how many visible connection will be there in mysqlprocess lokanath -Original Message- From: Struts Users Mailing List [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 4:19 AM To: [EMAIL PROTECTED] Subject: Multiple nested Hashmaps. Limit? I am running into a problem with multiple Mapped nested properties When I use the following lines to access the Value form my dynaValueObj Object I get this error <% String value="dynaTableObj.dynaRowObjs("+rowNm+").dynaValueObjs("+key+").dynaCo lumnValue"; %> [ServletException in:/WEB-INF/src/jsp/dyna/dynaTableData.jsp] Null property value for 'dynaValueObjs(1)'' After tracing I found that it is not calling getDynaValueObjs(String xx) but calling getDynaValueObjs(). Is there a limitation on how many map-backed properties you can reference? Thanks Randy Shelley [EMAIL PROTECTED] -- Dyna Table Form Bean public class DynaTableDataForm extends ActionForm { private DynaTableObj dynaTableObj = null; public DynaTableObj getDynaTableObj () { if (this.dynaTableObj==null) { this.dynaTableObj = new DynaTableObj(); } return this.dynaTableObj; } public void setDynaTableObj (DynaTableObj dynaTableObj) { this.dynaTableObj = dynaTableObj; } } Dyna Table Object public class DynaTableObj { private LinkedHashMap dynaColumnObjs = null; public DynaTableObj() {} public void setDynaColumnObjs(LinkedHashMap dynaColumnObjs) { this.dynaColumnObjs = dynaColumnObjs; } public LinkedHashMap getDynaColumnObjs() { return this.dynaColumnObjs; } public Object getDynaColumnObjs(String dynaColumnId) { if (dynaColumnObjs==null) { this.dynaColumnObjs = new LinkedHashMap(); this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj()); } else if (this.dynaColumnObjs.get(dynaColumnId)==null) { this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj()); } return this.dynaColumnObjs.get(dynaColumnId); } public void setDynaColumnObjs(String dynaColumnId,Object dynaColumnObj) { if (dynaColumnObjs==null) { this.dynaColumnObjs = new LinkedHashMap(); } this.dynaColumnObjs.put(dynaColumnId,dynaColumnObj); } } -- Dyna Row Object public class DynaRowObj { private LinkedHashMap dynaValueObjs = null; public DynaRowObj() {} public void setDynaValueObjs(LinkedHashMap dynaColumnObjs) { this.dynaValueObjs = dynaValueObjs; } public LinkedHashMap getDynaValueObjs() { return this.dynaValueObjs; } public Object getDynaValueObjs(String dynaColumnId) { if (dynaValueObjs==null) { this.dynaValueObjs = new LinkedHashMap(); this.dynaValueObjs.put(dynaColumnId,new DynaValueObj()); } else if (this.dynaValueObjs.get(dynaColumnId)==null) { this.dynaValueObjs.put(dynaColumnId,new DynaColumnObj()); } return this.dynaValueObjs.get(dynaColumnId); } public void setDynaValueObjs(String dynaColumnId,Object dynaValueObj) { if (dynaValueObjs==null) { this.dynaValueObjs = new LinkedHashMap(); } this.dynaValueObjs.put(dynaColumnId,dynaValueObj); } } - Dyna Value Object package rshelley.timesheet.util; public class DynaValueObj { private String dynaColumnValue = null; public DynaValueObj() { } public void setDynaColumnValue(String dynaColumnValue) { this.dynaColumnValue = dynaColumnValue; } public String getDynaColumnValue() { return this.dynaColumnValue; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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 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 -Original Message- From: Struts Users Mailing List [mailto:[EMAIL PROTECTED] Sent: Thursday, May 20, 2004 4:19 AM To: [EMAIL PROTECTED] Subject: Multiple nested Hashmaps. Limit? I am running into a problem with multiple Mapped nested properties When I use the following lines to access the Value form my dynaValueObj Object I get this error <% String value="dynaTableObj.dynaRowObjs("+rowNm+").dynaValueObjs("+key+").dynaCo lumnValue"; %> [ServletException in:/WEB-INF/src/jsp/dyna/dynaTableData.jsp] Null property value for 'dynaValueObjs(1)'' After tracing I found that it is not calling getDynaValueObjs(String xx) but calling getDynaValueObjs(). Is there a limitation on how many map-backed properties you can reference? Thanks Randy Shelley [EMAIL PROTECTED] -- Dyna Table Form Bean public class DynaTableDataForm extends ActionForm { private DynaTableObj dynaTableObj = null; public DynaTableObj getDynaTableObj () { if (this.dynaTableObj==null) { this.dynaTableObj = new DynaTableObj(); } return this.dynaTableObj; } public void setDynaTableObj (DynaTableObj dynaTableObj) { this.dynaTableObj = dynaTableObj; } } Dyna Table Object public class DynaTableObj { private LinkedHashMap dynaColumnObjs = null; public DynaTableObj() {} public void setDynaColumnObjs(LinkedHashMap dynaColumnObjs) { this.dynaColumnObjs = dynaColumnObjs; } public LinkedHashMap getDynaColumnObjs() { return this.dynaColumnObjs; } public Object getDynaColumnObjs(String dynaColumnId) { if (dynaColumnObjs==null) { this.dynaColumnObjs = new LinkedHashMap(); this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj()); } else if (this.dynaColumnObjs.get(dynaColumnId)==null) { this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj()); } return this.dynaColumnObjs.get(dynaColumnId); } public void setDynaColumnObjs(String dynaColumnId,Object dynaColumnObj) { if (dynaColumnObjs==null) { this.dynaColumnObjs = new LinkedHashMap(); } this.dynaColumnObjs.put(dynaColumnId,dynaColumnObj); } } -- Dyna Row Object public class DynaRowObj { private LinkedHashMap dynaValueObjs = null; public DynaRowObj() {} public void setDynaValueObjs(LinkedHashMap dynaColumnObjs) { this.dynaValueObjs = dynaValueObjs; } public LinkedHashMap getDynaValueObjs() { return this.dynaValueObjs; } public Object getDynaValueObjs(String dynaColumnId) { if (dynaValueObjs==null) { this.dynaValueObjs = new LinkedHashMap(); this.dynaValueObjs.put(dynaColumnId,new DynaValueObj()); } else if (this.dynaValueObjs.get(dynaColumnId)==null) { this.dynaValueObjs.put(dynaColumnId,new DynaColumnObj()); } return this.dynaValueObjs.get(dynaColumnId); } public void setDynaValueObjs(String dynaColumnId,Object dynaValueObj) { if (dynaValueObjs==null) { this.dynaValueObjs = new LinkedHashMap(); } this.dynaValueObjs.put(dynaColumnId,dynaValueObj); } } - Dyna Value Object package rshelley.timesheet.util; public class DynaValueObj { private String dynaColumnValue = null; public DynaValueObj() { } public void setDynaColumnValue(String dynaColumnValue) { this.dynaColumnValue = dynaColumnValue; } public String getDynaColumnValue() { return this.dynaColumnValue; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
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 from you. Compared to the pile of code below, I would MUCH prefer writing this: List results; try{ results = sqlmap.executeQueryForList("myQuery", myParameters); }catch(SqlMapException e){ // deal with one exception type } No need to build your sql statement (just say NO to StringBuffer.append()), map parameters by numbers (YUCK), clean up resources, etc...and you end up with very tight readable application code. Larry >>> [EMAIL PROTECTED] 04/07/04 7:00 AM >>> 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 consider a tool like iBATIS, but if you want to >do it yourself, here is the pattern: > >Connection c = null; >try{ > //get connection > try{ >// get statement >try{ > // get result set > // process result set >}finally{ > // close result set if not null >} > }finally{ >// close statement if not null > } >}finally{ > //close connection if not null >} > >Larry > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
Hi all, Closing all ResultSets, Statements, Connection in the finally block fixed my app that stops crashing. Thanks everybody... Marcelo On Wed, 07 Apr 2004 09:00:16 -0400, "Dean A. Hoover" <[EMAIL PROTECTED]> escreveu: > De: "Dean A. Hoover" <[EMAIL PROTECTED]> > 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 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 consider a tool like iBATIS, but if you want to > >do it yourself, here is the pattern: > > > >Connection c = null; > >try{ > > //get connection > > try{ > >// get statement > >try{ > > // get result set > > // process result set > >}finally{ > > // close result set if not null > >} > > }finally{ > >// close statement if not null > > } > >}finally{ > > //close connection if not null > >} > > > >Larry > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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 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 consider a tool like iBATIS, but if you want to do it yourself, here is the pattern: Connection c = null; try{ //get connection try{ // get statement try{ // get result set // process result set }finally{ // close result set if not null } }finally{ // close statement if not null } }finally{ //close connection if not null } Larry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Connection Pooling (How i use...)
Hi First of all - You have a memory leak in your application - Because : you do not close your resultset !! This may eventually lead to awkward situations. Hermod -Opprinnelig melding- Fra: Marcelo Epstein [mailto:[EMAIL PROTECTED] Sendt: 6. april 2004 18:31 Til: Struts Users Mailing 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"); DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/EasyDB"); if (ds != null) { Connection conn = ds.getConnection(); if (conn != null) { Statement stmt = conn.createStatement(); String query ="Any query"; ResultSet rs = stmt.executeQuery(query); while (rs.next()) { "Use ResulSet" } stmt.close(); conn.close(); } } } catch (Exception ex) { System.out.println(ex.toString()); } On Tue, 06 Apr 2004 10:19:15 -0600, "Larry Meadors" <[EMAIL PROTECTED]> escreveu: > De: "Larry Meadors" <[EMAIL PROTECTED]> > Data: Tue, 06 Apr 2004 10:19:15 -0600 > Para: <[EMAIL PROTECTED]> > Assunto: Re: Connection Pooling > > My bet is on a connection leak - you open one in a try block and don't close it in the finally block. > > >>> [EMAIL PROTECTED] 04/06/04 10:08 AM >>> > Hi, > > I have just started using Connection Pooling in my app (Tomcat, Struts, DBCP, Mysql) . > It woks for about 20 hours and stop working until tomcat restart. > > I get this exception: > > org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: > java.util.NoSuchElementException: Timeout waiting for idle object > > I canÌ t fix it. Any advice?? > > Thanks in advance. > Marcelo > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Connection Pooling (How i use...)
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 exception , may bejust ignore} } HTH Navjot Singh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
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 I can say is we spent some "interesting" hours trying to debug that one! Geeta Larry Meadors wrote: > 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 unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling - Monitor
Richard, I am already setting autoReconnect=true. I just want to know if exists any method that returns the # of opened connections are in the pool. Thanks. On Tue, 6 Apr 2004 10:54:06 -0700 (PDT), Richard Yee <[EMAIL PROTECTED]> escreveu: > De: Richard Yee <[EMAIL PROTECTED]> > 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 the URL > that you are using? You should set autoReconnect=true > in the URL. > > -Richard > > > > --- Marcelo Epstein <[EMAIL PROTECTED]> wrote: > > > > Is it possible to know how many connection are in > > the pool ? Is there any monitor available? > > > > > > On Tue, 6 Apr 2004 14:15:34 -0300, "Marcelo > > Epstein" <[EMAIL PROTECTED]> escreveu: > > > > > De: "Marcelo Epstein" <[EMAIL PROTECTED]> > > > Data: Tue, 6 Apr 2004 14:15:34 -0300 > > > 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.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html > > > doesn´t do that: > > > package foo; > > > > > > import javax.naming.*; > > > import javax.sql.*; > > > import java.sql.*; > > > > > > public class DBTest { > > > > > > String foo = "Not Connected"; > > > int bar = -1; > > > > > > public void init() { > > > try{ > > > Context ctx = new InitialContext(); > > > if(ctx == null ) > > > throw new Exception("Boom - No > > Context"); > > > > > > DataSource ds = > > > (DataSource)ctx.lookup( > > >"java:comp/env/jdbc/TestDB"); > > > > > > if (ds != null) { > > > Connection conn = ds.getConnection(); > > > > > > if(conn != null) { > > > foo = "Got Connection > > "+conn.toString(); > > > Statement stmt = > > conn.createStatement(); > > > ResultSet rst = > > > stmt.executeQuery( > > > "select id, foo, bar from > > testdata"); > > > if(rst.next()) { > > >foo=rst.getString(2); > > >bar=rst.getInt(3); > > > } > > > conn.close(); > > > } > > > } > > > }catch(Exception e) { > > > e.printStackTrace(); > > > } > > > } > > > > > > public String getFoo() { return foo; } > > > public int getBar() { return bar;} > > > } > > > > > > > > > > > > > > > On Tue, 06 Apr 2004 12:50:29 -0400, "Geeta Ramani" > > <[EMAIL PROTECTED]> escreveu: > > > > > > > De: "Geeta Ramani" <[EMAIL PROTECTED]> > > > > Data: Tue, 06 Apr 2004 12:50:29 -0400 > > > > Para: Struts Users Mailing List > > <[EMAIL PROTECTED]> > > > > Assunto: 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: > > > > > > > > > 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"); > > > > > > > > > > DataSource ds = (DataSource) > > ctx.lookup("java:comp/env/jdbc/EasyDB"); > > > > > > > > > > if (ds != null) { > > > > > Connection conn = > > ds.getConnection(); > > > > > if (conn != null) { > > > > > Statement stmt = > >
Re: Connection Pooling - Monitor
Marcelo, The # of connections is determined by the value you set when you defined your datasource. What is the URL that you are using? You should set autoReconnect=true in the URL. -Richard --- Marcelo Epstein <[EMAIL PROTECTED]> wrote: > > Is it possible to know how many connection are in > the pool ? Is there any monitor available? > > > On Tue, 6 Apr 2004 14:15:34 -0300, "Marcelo > Epstein" <[EMAIL PROTECTED]> escreveu: > > > De: "Marcelo Epstein" <[EMAIL PROTECTED]> > > Data: Tue, 6 Apr 2004 14:15:34 -0300 > > 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.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html > > doesn´t do that: > > package foo; > > > > import javax.naming.*; > > import javax.sql.*; > > import java.sql.*; > > > > public class DBTest { > > > > String foo = "Not Connected"; > > int bar = -1; > > > > public void init() { > > try{ > > Context ctx = new InitialContext(); > > if(ctx == null ) > > throw new Exception("Boom - No > Context"); > > > > DataSource ds = > > (DataSource)ctx.lookup( > >"java:comp/env/jdbc/TestDB"); > > > > if (ds != null) { > > Connection conn = ds.getConnection(); > > > > if(conn != null) { > > foo = "Got Connection > "+conn.toString(); > > Statement stmt = > conn.createStatement(); > > ResultSet rst = > > stmt.executeQuery( > > "select id, foo, bar from > testdata"); > > if(rst.next()) { > >foo=rst.getString(2); > >bar=rst.getInt(3); > > } > > conn.close(); > > } > > } > > }catch(Exception e) { > > e.printStackTrace(); > > } > > } > > > > public String getFoo() { return foo; } > > public int getBar() { return bar;} > > } > > > > > > > > > > On Tue, 06 Apr 2004 12:50:29 -0400, "Geeta Ramani" > <[EMAIL PROTECTED]> escreveu: > > > > > De: "Geeta Ramani" <[EMAIL PROTECTED]> > > > Data: Tue, 06 Apr 2004 12:50:29 -0400 > > > Para: Struts Users Mailing List > <[EMAIL PROTECTED]> > > > Assunto: 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: > > > > > > > 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"); > > > > > > > > DataSource ds = (DataSource) > ctx.lookup("java:comp/env/jdbc/EasyDB"); > > > > > > > > if (ds != null) { > > > > Connection conn = > ds.getConnection(); > > > > if (conn != null) { > > > > Statement stmt = > conn.createStatement(); > > > > String query ="Any > query"; > > > > ResultSet rs = > stmt.executeQuery(query); > > > > while (rs.next()) { > > > > > "Use ResulSet" > > > > > > > > } > > > > stmt.close(); > > > > conn.close(); > > > > } > > > > } > > > > } catch (Exception ex) { > > > > > System.out.println(ex.toString()); > > > > } > > > > > > > > On Tue, 06 Apr 2004 10:19:15 -0600, "Larry > Meadors" <[EMAIL PROTECTED]> escreveu: > > > > > > > > > De: "Larry Meadors" > <[EMAI
Re: Connection Pooling (How i use...)
*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 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 unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
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...! What i meant was the main thing is to make sure that closing/.returning the connection to the pool is done in a "finally" block and not as part of the try block. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
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, this issue was discussed in detail and in fcat the person with the initial question did a real nice write-up of her conclusions.. I think it will be well worth you while to read that thread.. Regards, Geeta Marcelo Epstein wrote: > Now I am closing the connection in the finally block. > The exemple provided by: > http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html > doesn´t do that: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
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 power of JDBC without the pain. Larry >>> [EMAIL PROTECTED] 04/06/04 11:15 AM >>> Now I am closing the connection in the finally block. The exemple... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Connection Pooling (How i use...)
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 unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection Pooling (How i use...)
well, you are right...! What i meant was the main thing is to make sure that closing/.returning the connection to the pool is done in a "finally" block and not as part of the try block. [EMAIL PROTECTED] wrote: > While using conn.close() does it return the connection to the pool?? > Its not a driver connection rather a data source connection...so waht happens when i > do conn.close()? > does it go back to the pool? > > -Original Message- > From: Geeta Ramani [mailto:[EMAIL PROTECTED] > Sent: Tue 4/6/2004 10:20 PM > 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: > > > 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"); > > > > DataSource ds = (DataSource) > ctx.lookup("java:comp/env/jdbc/EasyDB"); > > > > if (ds != null) { > > Connection conn = ds.getConnection(); > > if (conn != null) { > > Statement stmt = conn.createStatement(); > > String query ="Any query"; > > ResultSet rs = stmt.executeQuery(query); > > while (rs.next()) { > > "Use > ResulSet" > > > > } > > stmt.close(); > > conn.close(); > > } > > } > > } catch (Exception ex) { > > System.out.println(ex.toString()); > > } > > > > On Tue, 06 Apr 2004 10:19:15 -0600, "Larry Meadors" <[EMAIL PROTECTED]> > escreveu: > > > > > De: "Larry Meadors" <[EMAIL PROTECTED]> > > > Data: Tue, 06 Apr 2004 10:19:15 -0600 > > > Para: <[EMAIL PROTECTED]> > > > Assunto: Re: Connection Pooling > > > > > > My bet is on a connection leak - you open one in a try block and don't > close it in the finally block. > > > > > > >>> [EMAIL PROTECTED] 04/06/04 10:08 AM >>> > > > Hi, > > > > > > I have just started using Connection Pooling in my app (Tomcat, Struts, > DBCP, Mysql) . > > > It woks for about 20 hours and stop working until tomcat restart. > > > > > > I get this exception: > > > > > > org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, > pool exhausted, cause: > > > java.util.NoSuchElementException: Timeout waiting for idle object > > > > > > I canÌ t fix it. Any advice?? > > > > > > Thanks in advance. > > > Marcelo > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > DISCLAIMER: > This message con