You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "s.bernstein" <s....@attbi.com> on 2003/02/22 03:48:27 UTC
Problem w/ 2 jdbc DataSources
Hi,
I set up one JNDI/DBCP connection pool to one MySQL db following the JNDI
DataSources HOW-TO with seemingly no problems. I needed to add a second
MySQL running on the same machine under the same MySQL server (my W2K
development machine). I followed the exact same steps, only the db name and
URL are different. The username/pwd are the same between the two, though
the privileges are a little different. The second db has a separate
connection pool class, so there's one pool instantiated for each db in the
application scope for the web app.
Attempts to connect to the 2nd db don't go through. I replaced the
"getConnection()" call with a hard-coded DriverManager approach and it
worked, so I think that narrows it to the Tomcat config. Watching the
process under the "process" tab of WinMySQLadmin, refreshing constantly,
seems to indicate there's a failing logon loop after a JSP attempts to get a
connection. It seems to be infinite--I haven't waited for it to timeout.
Is there some config pitfall or instruction I missed for multiple database
environments?
Thanks for your help,
Steve
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Problem w/ 2 jdbc DataSources
Posted by "s.bernstein" <s....@attbi.com>.
Yeah, you're right. That dawned on me after the fact. Even a show tables
would have been better.
SB
----- Original Message -----
From: "Ian Hunter" <ih...@hunterweb.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, February 21, 2003 7:58 PM
Subject: Re: Problem w/ 2 jdbc DataSources
> In the future, don't select from a table, just do "select 0" or
something --
> that way, you're assured of connectivity but you don't do any real work...
> just my two cents.
>
> ----- Original Message -----
> From: "s.bernstein" <s....@attbi.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Friday, February 21, 2003 10:50 PM
> Subject: Re: Problem w/ 2 jdbc DataSources
>
>
> > Solved it. Pretty embarrassing. The
> > org.apache.commons.dbcp.BasicDataSourceFactory class has a setter for
> > "validationQuery", so I have an entry in server.xml for that. I
> mindlessly
> > set a SELECT on an empty table, so the loop was repeated attempts to
> > validate the query. It's always like that, isn't it?
> >
> > Steve
> >
> > ----- Original Message -----
> > From: "s.bernstein" <s....@attbi.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Friday, February 21, 2003 6:48 PM
> > Subject: Problem w/ 2 jdbc DataSources
> >
> >
> > > Hi,
> > > I set up one JNDI/DBCP connection pool to one MySQL db following the
> JNDI
> > > DataSources HOW-TO with seemingly no problems. I needed to add a
second
> > > MySQL running on the same machine under the same MySQL server (my W2K
> > > development machine). I followed the exact same steps, only the db
name
> > and
> > > URL are different. The username/pwd are the same between the two,
> though
> > > the privileges are a little different. The second db has a separate
> > > connection pool class, so there's one pool instantiated for each db in
> the
> > > application scope for the web app.
> > >
> > > Attempts to connect to the 2nd db don't go through. I replaced the
> > > "getConnection()" call with a hard-coded DriverManager approach and it
> > > worked, so I think that narrows it to the Tomcat config. Watching the
> > > process under the "process" tab of WinMySQLadmin, refreshing
constantly,
> > > seems to indicate there's a failing logon loop after a JSP attempts to
> get
> > a
> > > connection. It seems to be infinite--I haven't waited for it to
> timeout.
> > >
> > > Is there some config pitfall or instruction I missed for multiple
> database
> > > environments?
> > >
> > > Thanks for your help,
> > > Steve
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Problem w/ 2 jdbc DataSources
Posted by Ian Hunter <ih...@hunterweb.net>.
In the future, don't select from a table, just do "select 0" or something --
that way, you're assured of connectivity but you don't do any real work...
just my two cents.
----- Original Message -----
From: "s.bernstein" <s....@attbi.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, February 21, 2003 10:50 PM
Subject: Re: Problem w/ 2 jdbc DataSources
> Solved it. Pretty embarrassing. The
> org.apache.commons.dbcp.BasicDataSourceFactory class has a setter for
> "validationQuery", so I have an entry in server.xml for that. I
mindlessly
> set a SELECT on an empty table, so the loop was repeated attempts to
> validate the query. It's always like that, isn't it?
>
> Steve
>
> ----- Original Message -----
> From: "s.bernstein" <s....@attbi.com>
> To: <to...@jakarta.apache.org>
> Sent: Friday, February 21, 2003 6:48 PM
> Subject: Problem w/ 2 jdbc DataSources
>
>
> > Hi,
> > I set up one JNDI/DBCP connection pool to one MySQL db following the
JNDI
> > DataSources HOW-TO with seemingly no problems. I needed to add a second
> > MySQL running on the same machine under the same MySQL server (my W2K
> > development machine). I followed the exact same steps, only the db name
> and
> > URL are different. The username/pwd are the same between the two,
though
> > the privileges are a little different. The second db has a separate
> > connection pool class, so there's one pool instantiated for each db in
the
> > application scope for the web app.
> >
> > Attempts to connect to the 2nd db don't go through. I replaced the
> > "getConnection()" call with a hard-coded DriverManager approach and it
> > worked, so I think that narrows it to the Tomcat config. Watching the
> > process under the "process" tab of WinMySQLadmin, refreshing constantly,
> > seems to indicate there's a failing logon loop after a JSP attempts to
get
> a
> > connection. It seems to be infinite--I haven't waited for it to
timeout.
> >
> > Is there some config pitfall or instruction I missed for multiple
database
> > environments?
> >
> > Thanks for your help,
> > Steve
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Problem w/ 2 jdbc DataSources
Posted by "s.bernstein" <s....@attbi.com>.
Solved it. Pretty embarrassing. The
org.apache.commons.dbcp.BasicDataSourceFactory class has a setter for
"validationQuery", so I have an entry in server.xml for that. I mindlessly
set a SELECT on an empty table, so the loop was repeated attempts to
validate the query. It's always like that, isn't it?
Steve
----- Original Message -----
From: "s.bernstein" <s....@attbi.com>
To: <to...@jakarta.apache.org>
Sent: Friday, February 21, 2003 6:48 PM
Subject: Problem w/ 2 jdbc DataSources
> Hi,
> I set up one JNDI/DBCP connection pool to one MySQL db following the JNDI
> DataSources HOW-TO with seemingly no problems. I needed to add a second
> MySQL running on the same machine under the same MySQL server (my W2K
> development machine). I followed the exact same steps, only the db name
and
> URL are different. The username/pwd are the same between the two, though
> the privileges are a little different. The second db has a separate
> connection pool class, so there's one pool instantiated for each db in the
> application scope for the web app.
>
> Attempts to connect to the 2nd db don't go through. I replaced the
> "getConnection()" call with a hard-coded DriverManager approach and it
> worked, so I think that narrows it to the Tomcat config. Watching the
> process under the "process" tab of WinMySQLadmin, refreshing constantly,
> seems to indicate there's a failing logon loop after a JSP attempts to get
a
> connection. It seems to be infinite--I haven't waited for it to timeout.
>
> Is there some config pitfall or instruction I missed for multiple database
> environments?
>
> Thanks for your help,
> Steve
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org