Re: Tomcat DBCP 8.0.18 issue

2015-06-03 Thread Tweak Ronaldo
Hmm, interesting... Thanks for explanation Mark!

2015-06-03 12:22 GMT+03:00 Mark Thomas :

> On 03/06/2015 07:24, Tweak Ronaldo wrote:
> > Thanks Mark, yes I have mixed together Tomcat JDBC 8 and DBCP 7, my bad.
> > Although I don't understand why Tomcat JDBC don't use DBCP as default
> > solution for connections pooling.
>
> Tomcat does - and always has - used Commons DBCP for connection pooling
> by default.
>
> We do package rename Commons DBCP to avoid conflicts for web
> applications that package it in WEB-INF/lib and we have changed how we
> have done that repackaging over the years but the source code remains
> unchanged from which ever release version / tag / svn revision we select
> to pull in.
>
>
> What follows is a short(ish) history of Commons DBCP and tomcat-jdbc
> which attempts to explain why Tomcat ended up shipping two connection
> pools.
>
> Commons DBCP 1 has very poor performance in highly concurrent
> environments. Things improved during the 1.x series but really didn't
> improve much above 'awful'.
>
> As users started to run Tomcat on machines with increasing numbers of
> cores, the performance issues with DBCP 1 started to have a noticeable
> impact for some web applications. Something needed to be done to address
> the performance issues in concurrent environments.
>
> There were two options:
> a) fix DBCP (essentially this meant a major re-write for Commons Pool)
> b) implement a new connection pool
>
> My preference was for a) although I had little time to do any work along
> those lines. Keep in mind that my preference for a) is likely to have
> coloured my view of the history of this.
>
> Filip's preference was for b). He also felt that there was room to
> further improve performance by removing the overhead inherent in:
> i)  Commons DBCP being built on Commons Pool
> (a single module could be more tightly / efficiently integrated)
> ii) Commons DBCP aiming to fully follow the JDBC specs
> (making some of the behaviours optional reduced overhead for
>  users that didn't want/need them)
>
> Filip therefore wrote tomcat-jdbc. He tried to release it several times
> without success. Apache releases need 3 +1 votes and there simply wasn't
> the interest in this component from the other Tomcat developers (this
> was one of my concerns with this approach).
>
> In order to get it released, tomcat-jdbc was bundled with Tomcat from
> 7.0.19 onwards (July 2011) but it was never configured to be the default.
>
> Filip's focus at work moved away from Tomcat development in 2012. He
> does pop back from time to time (mainly to fix issues with tomcat-jdbc)
> but it is fair to say that - at the moment - issues in tomcat-jdbc are
> not being resolved in a timely manner.
>
> Around the same time tomcat-jdbc was bundled with Tomcat, I (and others
> from Commons) started on Commons Pool 2 and Commons DBCP 2. Pool 2 was
> finally released in 2013 and DBCP 2 in 2014 (Tomcat 8 always used DBCP 2
> and had been depending on snapshot versions for some time before that).
>
> Commons Pool 2 and Commons DBCP 2 continue to be maintained by the
> Commons community (there was a Pool 2.4.1 release just last week) and I
> aim to keep Tomcat's copy of DBCP 2 (and Pool 2) up to date.
>
> Generally, bugs reported against Commons DBCP2 and Commons Pool 2 are
> addressed in a timely manner.
>
> tomcat-jdbc provided (and continues to provide) a simple solution for
> those Tomcat 6 and Tomcat 7 users that needed better performance under
> concurrent loads. Tomcat 8 and onwards users have DBCP 2 so there is
> less need for tomcat-jdbc for those users.
>
> Hope this helps explain how we got to where we are.
>
> As I typed this, I started to wonder if we should even ship tomcat-jdbc
> with Tomcat 9. I'll start a discussion along those lines on the dev list.
>
> mark
>
> >
> > 2015-06-02 16:59 GMT+03:00 Mark Thomas :
> >
> >> On 01/06/2015 14:22, Tweak Ronaldo wrote:
> >>> Hello guys,
> >>
> >> Assuming you don't want to limit your question to men only, you would be
> >> better to use of of the following greetings:
> >> Hello,
> >> Hello all,
> >> Hello folks,
> >>
> >> etc.
> >>
> >>> we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
> >>> faced the following issue:
> >>> after database restart (Postgres), our application wasn't been able to
> >>> restore connectivity to DB, all connections were closed and every time,
> >>> after failed attempt to execute some SQL statement, returned back to
> >> pool.
> >>> Pool is configured with all tests (on borrow, on return, on connect,
> >> while
> >>> idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.
> >>> While using 7.0.37 DBCP is able to restore from DB restart, because
> >>> PoolableConnection class performs explicit check if underlying SQL
> >>> connection is closed:
> >>>
> >>>  public synchronized void close() throws SQLException {
> >>> if (_closed) {
> >>> // already closed
> >>> return;

Re: Tomcat DBCP 8.0.18 issue

2015-06-03 Thread Антон Мацюк
Mark, big thanks for a quick historical review, it was very intreresting!
I was thinking that tomcat-jdbc is something new, but wasn't sure about
project maintenance.

2015-06-03 12:22 GMT+03:00 Mark Thomas :

> On 03/06/2015 07:24, Tweak Ronaldo wrote:
> > Thanks Mark, yes I have mixed together Tomcat JDBC 8 and DBCP 7, my bad.
> > Although I don't understand why Tomcat JDBC don't use DBCP as default
> > solution for connections pooling.
>
> Tomcat does - and always has - used Commons DBCP for connection pooling
> by default.
>
> We do package rename Commons DBCP to avoid conflicts for web
> applications that package it in WEB-INF/lib and we have changed how we
> have done that repackaging over the years but the source code remains
> unchanged from which ever release version / tag / svn revision we select
> to pull in.
>
>
> What follows is a short(ish) history of Commons DBCP and tomcat-jdbc
> which attempts to explain why Tomcat ended up shipping two connection
> pools.
>
> Commons DBCP 1 has very poor performance in highly concurrent
> environments. Things improved during the 1.x series but really didn't
> improve much above 'awful'.
>
> As users started to run Tomcat on machines with increasing numbers of
> cores, the performance issues with DBCP 1 started to have a noticeable
> impact for some web applications. Something needed to be done to address
> the performance issues in concurrent environments.
>
> There were two options:
> a) fix DBCP (essentially this meant a major re-write for Commons Pool)
> b) implement a new connection pool
>
> My preference was for a) although I had little time to do any work along
> those lines. Keep in mind that my preference for a) is likely to have
> coloured my view of the history of this.
>
> Filip's preference was for b). He also felt that there was room to
> further improve performance by removing the overhead inherent in:
> i)  Commons DBCP being built on Commons Pool
> (a single module could be more tightly / efficiently integrated)
> ii) Commons DBCP aiming to fully follow the JDBC specs
> (making some of the behaviours optional reduced overhead for
>  users that didn't want/need them)
>
> Filip therefore wrote tomcat-jdbc. He tried to release it several times
> without success. Apache releases need 3 +1 votes and there simply wasn't
> the interest in this component from the other Tomcat developers (this
> was one of my concerns with this approach).
>
> In order to get it released, tomcat-jdbc was bundled with Tomcat from
> 7.0.19 onwards (July 2011) but it was never configured to be the default.
>
> Filip's focus at work moved away from Tomcat development in 2012. He
> does pop back from time to time (mainly to fix issues with tomcat-jdbc)
> but it is fair to say that - at the moment - issues in tomcat-jdbc are
> not being resolved in a timely manner.
>
> Around the same time tomcat-jdbc was bundled with Tomcat, I (and others
> from Commons) started on Commons Pool 2 and Commons DBCP 2. Pool 2 was
> finally released in 2013 and DBCP 2 in 2014 (Tomcat 8 always used DBCP 2
> and had been depending on snapshot versions for some time before that).
>
> Commons Pool 2 and Commons DBCP 2 continue to be maintained by the
> Commons community (there was a Pool 2.4.1 release just last week) and I
> aim to keep Tomcat's copy of DBCP 2 (and Pool 2) up to date.
>
> Generally, bugs reported against Commons DBCP2 and Commons Pool 2 are
> addressed in a timely manner.
>
> tomcat-jdbc provided (and continues to provide) a simple solution for
> those Tomcat 6 and Tomcat 7 users that needed better performance under
> concurrent loads. Tomcat 8 and onwards users have DBCP 2 so there is
> less need for tomcat-jdbc for those users.
>
> Hope this helps explain how we got to where we are.
>
> As I typed this, I started to wonder if we should even ship tomcat-jdbc
> with Tomcat 9. I'll start a discussion along those lines on the dev list.
>
> mark
>
> >
> > 2015-06-02 16:59 GMT+03:00 Mark Thomas :
> >
> >> On 01/06/2015 14:22, Tweak Ronaldo wrote:
> >>> Hello guys,
> >>
> >> Assuming you don't want to limit your question to men only, you would be
> >> better to use of of the following greetings:
> >> Hello,
> >> Hello all,
> >> Hello folks,
> >>
> >> etc.
> >>
> >>> we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
> >>> faced the following issue:
> >>> after database restart (Postgres), our application wasn't been able to
> >>> restore connectivity to DB, all connections were closed and every time,
> >>> after failed attempt to execute some SQL statement, returned back to
> >> pool.
> >>> Pool is configured with all tests (on borrow, on return, on connect,
> >> while
> >>> idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.
> >>> While using 7.0.37 DBCP is able to restore from DB restart, because
> >>> PoolableConnection class performs explicit check if underlying SQL
> >>> connection is closed:
> >>>
> >>>  public synchronized void cl

Re: Tomcat DBCP 8.0.18 issue

2015-06-03 Thread Mark Thomas
On 03/06/2015 07:24, Tweak Ronaldo wrote:
> Thanks Mark, yes I have mixed together Tomcat JDBC 8 and DBCP 7, my bad.
> Although I don't understand why Tomcat JDBC don't use DBCP as default
> solution for connections pooling.

Tomcat does - and always has - used Commons DBCP for connection pooling
by default.

We do package rename Commons DBCP to avoid conflicts for web
applications that package it in WEB-INF/lib and we have changed how we
have done that repackaging over the years but the source code remains
unchanged from which ever release version / tag / svn revision we select
to pull in.


What follows is a short(ish) history of Commons DBCP and tomcat-jdbc
which attempts to explain why Tomcat ended up shipping two connection pools.

Commons DBCP 1 has very poor performance in highly concurrent
environments. Things improved during the 1.x series but really didn't
improve much above 'awful'.

As users started to run Tomcat on machines with increasing numbers of
cores, the performance issues with DBCP 1 started to have a noticeable
impact for some web applications. Something needed to be done to address
the performance issues in concurrent environments.

There were two options:
a) fix DBCP (essentially this meant a major re-write for Commons Pool)
b) implement a new connection pool

My preference was for a) although I had little time to do any work along
those lines. Keep in mind that my preference for a) is likely to have
coloured my view of the history of this.

Filip's preference was for b). He also felt that there was room to
further improve performance by removing the overhead inherent in:
i)  Commons DBCP being built on Commons Pool
(a single module could be more tightly / efficiently integrated)
ii) Commons DBCP aiming to fully follow the JDBC specs
(making some of the behaviours optional reduced overhead for
 users that didn't want/need them)

Filip therefore wrote tomcat-jdbc. He tried to release it several times
without success. Apache releases need 3 +1 votes and there simply wasn't
the interest in this component from the other Tomcat developers (this
was one of my concerns with this approach).

In order to get it released, tomcat-jdbc was bundled with Tomcat from
7.0.19 onwards (July 2011) but it was never configured to be the default.

Filip's focus at work moved away from Tomcat development in 2012. He
does pop back from time to time (mainly to fix issues with tomcat-jdbc)
but it is fair to say that - at the moment - issues in tomcat-jdbc are
not being resolved in a timely manner.

Around the same time tomcat-jdbc was bundled with Tomcat, I (and others
from Commons) started on Commons Pool 2 and Commons DBCP 2. Pool 2 was
finally released in 2013 and DBCP 2 in 2014 (Tomcat 8 always used DBCP 2
and had been depending on snapshot versions for some time before that).

Commons Pool 2 and Commons DBCP 2 continue to be maintained by the
Commons community (there was a Pool 2.4.1 release just last week) and I
aim to keep Tomcat's copy of DBCP 2 (and Pool 2) up to date.

Generally, bugs reported against Commons DBCP2 and Commons Pool 2 are
addressed in a timely manner.

tomcat-jdbc provided (and continues to provide) a simple solution for
those Tomcat 6 and Tomcat 7 users that needed better performance under
concurrent loads. Tomcat 8 and onwards users have DBCP 2 so there is
less need for tomcat-jdbc for those users.

Hope this helps explain how we got to where we are.

As I typed this, I started to wonder if we should even ship tomcat-jdbc
with Tomcat 9. I'll start a discussion along those lines on the dev list.

mark

> 
> 2015-06-02 16:59 GMT+03:00 Mark Thomas :
> 
>> On 01/06/2015 14:22, Tweak Ronaldo wrote:
>>> Hello guys,
>>
>> Assuming you don't want to limit your question to men only, you would be
>> better to use of of the following greetings:
>> Hello,
>> Hello all,
>> Hello folks,
>>
>> etc.
>>
>>> we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
>>> faced the following issue:
>>> after database restart (Postgres), our application wasn't been able to
>>> restore connectivity to DB, all connections were closed and every time,
>>> after failed attempt to execute some SQL statement, returned back to
>> pool.
>>> Pool is configured with all tests (on borrow, on return, on connect,
>> while
>>> idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.
>>> While using 7.0.37 DBCP is able to restore from DB restart, because
>>> PoolableConnection class performs explicit check if underlying SQL
>>> connection is closed:
>>>
>>>  public synchronized void close() throws SQLException {
>>> if (_closed) {
>>> // already closed
>>> return;
>>> }
>>>
>>> boolean isUnderlyingConectionClosed;
>>> try {
>>> isUnderlyingConectionClosed = _conn.isClosed();
>>> } catch (SQLException e) {
>>> try {
>>> _pool.invalidateObject(this); // XXX should be guarded to
>>> h

Re: Tomcat DBCP 8.0.18 issue

2015-06-02 Thread Tweak Ronaldo
Thanks Mark, yes I have mixed together Tomcat JDBC 8 and DBCP 7, my bad.
Although I don't understand why Tomcat JDBC don't use DBCP as default
solution for connections pooling.

2015-06-02 16:59 GMT+03:00 Mark Thomas :

> On 01/06/2015 14:22, Tweak Ronaldo wrote:
> > Hello guys,
>
> Assuming you don't want to limit your question to men only, you would be
> better to use of of the following greetings:
> Hello,
> Hello all,
> Hello folks,
>
> etc.
>
> > we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
> > faced the following issue:
> > after database restart (Postgres), our application wasn't been able to
> > restore connectivity to DB, all connections were closed and every time,
> > after failed attempt to execute some SQL statement, returned back to
> pool.
> > Pool is configured with all tests (on borrow, on return, on connect,
> while
> > idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.
> > While using 7.0.37 DBCP is able to restore from DB restart, because
> > PoolableConnection class performs explicit check if underlying SQL
> > connection is closed:
> >
> >  public synchronized void close() throws SQLException {
> > if (_closed) {
> > // already closed
> > return;
> > }
> >
> > boolean isUnderlyingConectionClosed;
> > try {
> > isUnderlyingConectionClosed = _conn.isClosed();
> > } catch (SQLException e) {
> > try {
> > _pool.invalidateObject(this); // XXX should be guarded to
> > happen at most once
> > } catch(IllegalStateException ise) {
> > // pool is closed, so close the connection
> > passivate();
> > getInnermostDelegate().close();
> > } catch (Exception ie) {
> > // DO NOTHING the original exception will be rethrown
> > }
> > throw (SQLException) new SQLException("Cannot close
> connection
> > (isClosed check failed)").initCause(e);
> > }
> >...
> >
> > My question is: why this check was removed and how can one get the same
> > behaviour (of 7.0.37) using 8.0.18 (not using on borrow, on return, while
> > idle validations, which are SQL queries)? I see that there is a property
> in
> > pool configuration which allows user to provide custom Validator, though
> I
> > don't want to go this way because DBCP configuration is performed by 3rd
> > party library and we don't have direct access to it.
>
> The check to which you refer was not removed. It is still present in the
> code base and - as far as I can tell from a quick look at svn - never
> been removed.
>
> DBCP has no support for a custom validator. You appear to have confused
> something else with Tomcat's port of Commons DBCP (the Tomcat JDBC pool
> perhaps?).
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat DBCP 8.0.18 issue

2015-06-02 Thread Konstantin Kolinko
2015-06-01 16:22 GMT+03:00 Tweak Ronaldo :
> Hello guys, we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
> faced the following issue:
> after database restart (Postgres), our application wasn't been able to
> restore connectivity to DB, all connections were closed and every time,
> after failed attempt to execute some SQL statement, returned back to pool.
> Pool is configured with all tests (on borrow, on return, on connect, while
> idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.

"the same"?
Tomcat 7 uses DBCP 1 and Tomcat 8 uses DBCP 2, where some attributes
have different names.

As mentioned in migration guide:
http://tomcat.apache.org/migration-8.html#Database_Connection_Pooling

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP 8.0.18 issue

2015-06-02 Thread Mark Thomas
On 01/06/2015 14:22, Tweak Ronaldo wrote:
> Hello guys,

Assuming you don't want to limit your question to men only, you would be
better to use of of the following greetings:
Hello,
Hello all,
Hello folks,

etc.

> we have migrated to Tomcat DBCP 8.0.18 from 7.0.37 recently and
> faced the following issue:
> after database restart (Postgres), our application wasn't been able to
> restore connectivity to DB, all connections were closed and every time,
> after failed attempt to execute some SQL statement, returned back to pool.
> Pool is configured with all tests (on borrow, on return, on connect, while
> idle) disabled. Pool configuration is the same for 8.0.18 and 7.0.37.
> While using 7.0.37 DBCP is able to restore from DB restart, because
> PoolableConnection class performs explicit check if underlying SQL
> connection is closed:
> 
>  public synchronized void close() throws SQLException {
> if (_closed) {
> // already closed
> return;
> }
> 
> boolean isUnderlyingConectionClosed;
> try {
> isUnderlyingConectionClosed = _conn.isClosed();
> } catch (SQLException e) {
> try {
> _pool.invalidateObject(this); // XXX should be guarded to
> happen at most once
> } catch(IllegalStateException ise) {
> // pool is closed, so close the connection
> passivate();
> getInnermostDelegate().close();
> } catch (Exception ie) {
> // DO NOTHING the original exception will be rethrown
> }
> throw (SQLException) new SQLException("Cannot close connection
> (isClosed check failed)").initCause(e);
> }
>...
> 
> My question is: why this check was removed and how can one get the same
> behaviour (of 7.0.37) using 8.0.18 (not using on borrow, on return, while
> idle validations, which are SQL queries)? I see that there is a property in
> pool configuration which allows user to provide custom Validator, though I
> don't want to go this way because DBCP configuration is performed by 3rd
> party library and we don't have direct access to it.

The check to which you refer was not removed. It is still present in the
code base and - as far as I can tell from a quick look at svn - never
been removed.

DBCP has no support for a custom validator. You appear to have confused
something else with Tomcat's port of Commons DBCP (the Tomcat JDBC pool
perhaps?).

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Logging

2013-03-06 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Rahul,

On 3/6/13 12:49 PM, Rahul Somasunderam wrote:
> I'm running Tomcat 7.0.23. I've got a question about configuring
> the logging of DBCP Failures.

Echoing Daniel's suggestion: upgrade.

> I've go this in my context xml file.
> 
> 

The "path" attribute is illegal, here: remove it.

>  type="javax.sql.DataSource" 
> driverClassName="oracle.jdbc.OracleDriver" 
> url="jdbc:oracle:thin:@//localhost:1531/PROD" username="foouser" 
> password="foopass" />

 looks good: you confirm that it works properly when
username/password are correct.

> When the username and password are correct, I have no trouble 
> connecting and my application works as expected. However when this
> is wrong, I get no indication of why it went wrong. I suppose
> Tomcat/DBCP is catching the exception and not logging it.

Nope: Tomcat/DBCP does not catch any of these exceptions. If I change
my username/password to incorrect ones, I get an exception for each
connection attempt. My application code catches the exception and logs
it appropriately.

If you fetch the connection in a JSP and don't have any catch blocks,
the JSP compiler adds try/catch for you and re-throws the exception as
a ServletException -- servlet can only throw ServletException and
IOException.

If you use some framework (Spring, Struts, etc.) with a
front-controller, they can all be configured with their own error
handlers: perhaps you have poorly-configured one of these components.

If you wrote your own servlet, then you should read your own code
because you are probably catching and swallowing these exceptions.

How do you fetch a connection from the pool?

> When I try from outside of tomcat using jdbc, I see Oracle
> returning a ORA-01017 error code and jdbc throwing an exception.
> 
> What must I do in the logging.properties to make tomcat log this?

AFAIK, nothing: Tomcat should log any uncaught exception. Do you get a
Tomcat 500 response page with a stack trace? If not, some other
component (under /your/ control) is handling the exception - and not
the way you want it to.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlE4IWkACgkQ9CaO5/Lv0PBAHACgkklRQ3gHYFuYrahND3bOtW8C
xsYAn0yw1zEGnQkNV3JxCaR48TrJOjHO
=8CKa
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Logging

2013-03-06 Thread Rahul Somasunderam
Thanks Dan,

The initialSize brought the logs into my catalina.out.

R,
rahul

On Mar 6, 2013, at 2:21 PM, Daniel Mikusa  wrote:

> On Mar 6, 2013, at 5:07 PM, Rahul Somasunderam wrote:
> 
>> 
>> On Mar 6, 2013, at 11:26 AM, Daniel Mikusa  wrote:
>> 
>>> On Mar 6, 2013, at 1:49 PM, Rahul Somasunderam wrote:
>>> 
 Hi,
 
 I'm running Tomcat 7.0.23.
>>> 
>>> This is getting pretty old, you might want to consider upgrading.
>> 
>> I will, but I don't think this has to do much with tomcat being old. I think 
>> it's with me having to configure the logging correctly.
> 
> You're right, this is not related to the issue at hand.  It's just a general 
> reminder :)
> 
>> 
>>> 
 I've got a question about configuring the logging of DBCP Failures. 
 
 I've go this in my context xml file.
 
 
 >>>name="jdbc/hd/datasource"
auth="Container"
type="javax.sql.DataSource"
driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@//localhost:1531/PROD"
username="foouser"
password="foopass"
 />
 
 
 When the username and password are correct, I have no trouble connecting 
 and my application works as expected.
 However when this is wrong, I get no indication of why it went wrong.
>>> 
>>> When it's wrong what happens?  How are you testing for failure?  Are you 
>>> accessing a page in your app that requires the DB?
>> 
>> I'm testing this by changing the password in my context to be a wrong 
>> password. I'm looking at the startup logs and I see this in catalina.out
>> 
>> Mar 06, 2013 11:57:27 AM org.apache.catalina.core.StandardContext 
>> startInternal
>> SEVERE: Error listenerStart
>> Mar 06, 2013 11:57:27 AM org.apache.catalina.core.StandardContext 
>> startInternal
>> SEVERE: Context [/foo] startup failed due to previous errors
> 
> Your application failed to start for some reason.  It appears that a listener 
> has failed.  You should check the other Tomcat log files and your application 
> log files for clues.
> 
>> 
>> And this in localhost.date.log
>> 
>> Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
>> INFO: ContextListener: contextInitialized()
>> Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: contextInitialized()
>> Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
>> INFO: ContextListener: 
>> attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 
>> 'org.apache.jasper.compiler.TldLocationsCache@1296dee6')
>> Mar 06, 2013 11:56:55 AM org.apache.catalina.core.ApplicationContext log
>> INFO: Initializing Spring root WebApplicationContext
>> Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
>> INFO: ContextListener: contextInitialized()
>> Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
>> INFO: SessionListener: contextInitialized()
>> Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
> 
> Is this the entire localhost.-MM-DD.log file?  Given the SEVERE log in 
> catalina.out, I would have expected an exception here.
> 
> Dan
> 
> PS.  Have you tried setting the "initialSize" attribute on your  
> tag?  That should force DBCP to create a connection at startup and, if that 
> connection fails, it should log it.  I tested this in my Tomcat setup, with 
> an out-of-the-box logging configuration, and it worked fine.
> 
> 
>> 
>>> 
 I suppose Tomcat/DBCP is catching the exception and not logging it.
>>> 
>>> Hard to say for sure, but it's possible that DBCP may not even be 
>>> connecting to the Database.  The "initialSize" parameter defaults to 0, so 
>>> on startup it won't make any connections.  Maybe try setting "initialSize" 
>>> to "1" and see what happens.
>>> 
>>> https://commons.apache.org/dbcp/configuration.html
>>> 
>>> Dan
>>> 
 When I try from outside of tomcat using jdbc, I see Oracle returning a 
 ORA-01017 error code and jdbc throwing an exception.
 
 What must I do in the logging.properties to make tomcat log this?
 
 R,
 rahul
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



smime.p7s
Description: S/MIME cryptographic signature


Re: Tomcat DBCP Logging

2013-03-06 Thread Daniel Mikusa
On Mar 6, 2013, at 5:07 PM, Rahul Somasunderam wrote:

> 
> On Mar 6, 2013, at 11:26 AM, Daniel Mikusa  wrote:
> 
>> On Mar 6, 2013, at 1:49 PM, Rahul Somasunderam wrote:
>> 
>>> Hi,
>>> 
>>> I'm running Tomcat 7.0.23.
>> 
>> This is getting pretty old, you might want to consider upgrading.
> 
> I will, but I don't think this has to do much with tomcat being old. I think 
> it's with me having to configure the logging correctly.

You're right, this is not related to the issue at hand.  It's just a general 
reminder :)

> 
>> 
>>> I've got a question about configuring the logging of DBCP Failures. 
>>> 
>>> I've go this in my context xml file.
>>> 
>>> 
>>> >> name="jdbc/hd/datasource"
>>> auth="Container"
>>> type="javax.sql.DataSource"
>>> driverClassName="oracle.jdbc.OracleDriver"
>>> url="jdbc:oracle:thin:@//localhost:1531/PROD"
>>> username="foouser"
>>> password="foopass"
>>> />
>>> 
>>> 
>>> When the username and password are correct, I have no trouble connecting 
>>> and my application works as expected.
>>> However when this is wrong, I get no indication of why it went wrong.
>> 
>> When it's wrong what happens?  How are you testing for failure?  Are you 
>> accessing a page in your app that requires the DB?
> 
> I'm testing this by changing the password in my context to be a wrong 
> password. I'm looking at the startup logs and I see this in catalina.out
> 
> Mar 06, 2013 11:57:27 AM org.apache.catalina.core.StandardContext 
> startInternal
> SEVERE: Error listenerStart
> Mar 06, 2013 11:57:27 AM org.apache.catalina.core.StandardContext 
> startInternal
> SEVERE: Context [/foo] startup failed due to previous errors

Your application failed to start for some reason.  It appears that a listener 
has failed.  You should check the other Tomcat log files and your application 
log files for clues.

> 
> And this in localhost.date.log
> 
> Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
> INFO: ContextListener: contextInitialized()
> Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
> INFO: SessionListener: contextInitialized()
> Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
> INFO: ContextListener: 
> attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 
> 'org.apache.jasper.compiler.TldLocationsCache@1296dee6')
> Mar 06, 2013 11:56:55 AM org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring root WebApplicationContext
> Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
> INFO: ContextListener: contextInitialized()
> Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
> INFO: SessionListener: contextInitialized()
> Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log

Is this the entire localhost.-MM-DD.log file?  Given the SEVERE log in 
catalina.out, I would have expected an exception here.

Dan

PS.  Have you tried setting the "initialSize" attribute on your  
tag?  That should force DBCP to create a connection at startup and, if that 
connection fails, it should log it.  I tested this in my Tomcat setup, with an 
out-of-the-box logging configuration, and it worked fine.


> 
>> 
>>> I suppose Tomcat/DBCP is catching the exception and not logging it.
>> 
>> Hard to say for sure, but it's possible that DBCP may not even be connecting 
>> to the Database.  The "initialSize" parameter defaults to 0, so on startup 
>> it won't make any connections.  Maybe try setting "initialSize" to "1" and 
>> see what happens.
>> 
>> https://commons.apache.org/dbcp/configuration.html
>> 
>> Dan
>> 
>>> When I try from outside of tomcat using jdbc, I see Oracle returning a 
>>> ORA-01017 error code and jdbc throwing an exception.
>>> 
>>> What must I do in the logging.properties to make tomcat log this?
>>> 
>>> R,
>>> rahul
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Logging

2013-03-06 Thread Rahul Somasunderam

On Mar 6, 2013, at 11:26 AM, Daniel Mikusa  wrote:

> On Mar 6, 2013, at 1:49 PM, Rahul Somasunderam wrote:
> 
>> Hi,
>> 
>> I'm running Tomcat 7.0.23.
> 
> This is getting pretty old, you might want to consider upgrading.

I will, but I don't think this has to do much with tomcat being old. I think 
it's with me having to configure the logging correctly.

> 
>> I've got a question about configuring the logging of DBCP Failures. 
>> 
>> I've go this in my context xml file.
>> 
>> 
>>  >  name="jdbc/hd/datasource"
>>  auth="Container"
>>  type="javax.sql.DataSource"
>>  driverClassName="oracle.jdbc.OracleDriver"
>>  url="jdbc:oracle:thin:@//localhost:1531/PROD"
>>  username="foouser"
>>  password="foopass"
>>  />
>> 
>> 
>> When the username and password are correct, I have no trouble connecting and 
>> my application works as expected.
>> However when this is wrong, I get no indication of why it went wrong.
> 
> When it's wrong what happens?  How are you testing for failure?  Are you 
> accessing a page in your app that requires the DB?

I'm testing this by changing the password in my context to be a wrong password. 
I'm looking at the startup logs and I see this in catalina.out

Mar 06, 2013 11:57:27 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Mar 06, 2013 11:57:27 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/foo] startup failed due to previous errors

And this in localhost.date.log

Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 06, 2013 10:13:17 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: 
attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 
'org.apache.jasper.compiler.TldLocationsCache@1296dee6')
Mar 06, 2013 11:56:55 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 06, 2013 11:58:57 AM org.apache.catalina.core.ApplicationContext log


> 
>> I suppose Tomcat/DBCP is catching the exception and not logging it.
> 
> Hard to say for sure, but it's possible that DBCP may not even be connecting 
> to the Database.  The "initialSize" parameter defaults to 0, so on startup it 
> won't make any connections.  Maybe try setting "initialSize" to "1" and see 
> what happens.
> 
>  https://commons.apache.org/dbcp/configuration.html
> 
> Dan
> 
>> When I try from outside of tomcat using jdbc, I see Oracle returning a 
>> ORA-01017 error code and jdbc throwing an exception.
>> 
>> What must I do in the logging.properties to make tomcat log this?
>> 
>> R,
>> rahul
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



smime.p7s
Description: S/MIME cryptographic signature


Re: Tomcat DBCP Logging

2013-03-06 Thread Daniel Mikusa
On Mar 6, 2013, at 1:49 PM, Rahul Somasunderam wrote:

> Hi,
> 
> I'm running Tomcat 7.0.23.

This is getting pretty old, you might want to consider upgrading.

> I've got a question about configuring the logging of DBCP Failures. 
> 
> I've go this in my context xml file.
> 
> 
>  name="jdbc/hd/datasource"
>   auth="Container"
>   type="javax.sql.DataSource"
>   driverClassName="oracle.jdbc.OracleDriver"
>   url="jdbc:oracle:thin:@//localhost:1531/PROD"
>   username="foouser"
>   password="foopass"
>   />
> 
> 
> When the username and password are correct, I have no trouble connecting and 
> my application works as expected.
> However when this is wrong, I get no indication of why it went wrong.

When it's wrong what happens?  How are you testing for failure?  Are you 
accessing a page in your app that requires the DB?

> I suppose Tomcat/DBCP is catching the exception and not logging it.

Hard to say for sure, but it's possible that DBCP may not even be connecting to 
the Database.  The "initialSize" parameter defaults to 0, so on startup it 
won't make any connections.  Maybe try setting "initialSize" to "1" and see 
what happens.

  https://commons.apache.org/dbcp/configuration.html

Dan

> When I try from outside of tomcat using jdbc, I see Oracle returning a 
> ORA-01017 error code and jdbc throwing an exception.
> 
> What must I do in the logging.properties to make tomcat log this?
> 
> R,
> rahul

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP & SQLServer failover

2012-10-12 Thread Jose María Zaragoza
>>
>> I agree with you. Because of that,  I've got that question :-)
>
> Hopefully I've answered it..?
>
> - -chris

A lof of thanks, Chris.
I'm going to test it and I'll make feedback to the list

Regards

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP & SQLServer failover

2012-10-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jose,

On 10/11/12 3:31 PM, Jose María Zaragoza wrote:
>> How can you tell the difference between a primary server being
>> "down" and the primary server needing to (otherwise?) fail-over
>> to the backup? I'm confused about your nomenclature (primary
>> failover means mirror -> primary?).
> 
> Well, I'm newbie in SQLServer but I think that  primary and mirror
> are sending message to each other ( mirroring session ) When
> primary fails, mirror becomes the primary
> 
> About SQLServer documentation, when a connection is established to
> a primary server (which is on a mirroring session) , is returned to
> it the configuration of the mirror ( who is the primary, who is
> the mirror ). So, if there is a fail when you are using that
> connection, a SQLException is thrown . About the SQLServer  , you
> must close that connection and get a new one. In theory, this new
> connections knows what is the right server to connect ( driver
> knows it )
> 
> So, this is my question: what does happen with connections living
> at pool ?

It sounds like just with any other database: if you enable a
validationQuery then failover (or any kind) will be transparent to the
application: DBCP will test the connection, if failover occurs a
SQLException if thrown, DBCP catches that exception, closes the
connection, and creates a new one. The driver should know about the
failover and connect to the secondary server and return a fresh
Connection, which gets returned to the application. I don't know how
many times DBCP will repeat this for a single getConnection call.

The pool will slowly turn-over as the application requests (now
invalid) connections and each of them will be refreshed as needed.

>> AFAIK, DBCP knows nothing about failover: all that stuff happens
>> at the JDBC driver-level.
> 
> I agree with you. Because of that,  I've got that question :-)

Hopefully I've answered it..?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB4KFIACgkQ9CaO5/Lv0PCoJwCdGug2+jVGrKS+xn+mEQxvj1JT
Me4AoK2UcvPgN2HUDaUpXkhgPpC1vKVW
=HlLC
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP & SQLServer failover

2012-10-11 Thread Jose María Zaragoza
> How can you tell the difference between a primary server being "down"
> and the primary server needing to (otherwise?) fail-over to the
> backup? I'm confused about your nomenclature (primary failover means
> mirror -> primary?).

Well, I'm newbie in SQLServer but I think that  primary and mirror are
sending message to each other ( mirroring session )
When primary fails, mirror becomes the primary

About SQLServer documentation, when a connection is established to a
primary server (which is on a mirroring session) , is returned to it
the configuration of the mirror ( who is the primary, who is the
mirror ).
So, if there is a fail when you are using that connection, a
SQLException is thrown . About the SQLServer  , you must close that
connection and get a new one. In theory, this new connections knows
what is the right server to connect ( driver knows it )

So, this is my question: what does happen with connections living at pool ?

>
> AFAIK, DBCP knows nothing about failover: all that stuff happens at
> the JDBC driver-level.

I agree with you. Because of that,  I've got that question :-)


Thanks and regards

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP & SQLServer failover

2012-10-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jose María,

On 10/10/12 3:00 PM, Jose María Zaragoza wrote:
> I want to add  database failover to my web application I use Tomcat
> 6 and SQLServer database + JDBC Driver 3.0
> 
> But my doubts are about what happen with pooled connections. The
> scenario is my pool is populated by connections to primary server. 
> Then, the primary server fails and a failover happens ( mirror -> 
> primary ) I'm not talking about the case where the primary server
> is down and DBCP tries to create new connections

How can you tell the difference between a primary server being "down"
and the primary server needing to (otherwise?) fail-over to the
backup? I'm confused about your nomenclature (primary failover means
mirror -> primary?).

AFAIK, DBCP knows nothing about failover: all that stuff happens at
the JDBC driver-level.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB157oACgkQ9CaO5/Lv0PAcBgCgpuWvOxpz0fdSJGddJYiV1UZN
nlcAnRxO2/SA4DOi1YJ+PseFuOUacEvJ
=8ijB
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-28 Thread Kiran Badi

On 6/27/2012 8:35 PM, Christopher Schultz wrote:

100 active db connections sounds like a lot. Do you really need to
support 100 simultaneous connections to your database? Can your
database support that many connections with active queries from each?
Do you have a cluster? Remember that each member in the cluster will
therefore open a maximum of 100 connections to your database. 10
cluster members means 1000 simultaneous connections.
to begin with I am targetting 1000 users at any time.I know this is too 
much to dream off.But again let me try for that.


I will enable abondered detection settings.Thanks for bringing to notice.

There's no time like the present: this problem will only get worse
over time.

I had written a bunch of DAO  classes sometimes back,but there was bug in DB 
design(for one functionality,I forgot to relate tables properly) and after 
fixing that I somehow forgot to to use model 2 design(again my bad its hard to 
wire the brain to work this way when you can just make easy calls and then 
present data to the client and yet do MVC) and started working  old way and due 
to this db calls went into the servlet.For other module I am fixing this and 
will make action servlet which will read request uri and then do the 
appropriate action.I have almost visualised,inserts and deletes.Trying to find 
the way to see how to make edit work.I have around 10 images and around 10 
fields which I need to perists somewhere before final insert.

God bless me.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 6/26/12 7:24 PM, Kiran Badi wrote:
>  type="javax.sql.DataSource" maxActive="100" maxIdle="30"
> maxWait="1"

100 active db connections sounds like a lot. Do you really need to
support 100 simultaneous connections to your database? Can your
database support that many connections with active queries from each?
Do you have a cluster? Remember that each member in the cluster will
therefore open a maximum of 100 connections to your database. 10
cluster members means 1000 simultaneous connections.

> I had a bug in my code  and I was not closing connection, I fixed
> it and now this is working fine.

You should enable "abandoned" detection and logging.

>> an architectural comment: it's probably not a great idea to 
>> obtain a database connection directly from your Servlet. Doing
>> so likely ties your business logic directly to both the servlet
>> API *and* the JDBC API.
>> 
>> If you want to switch to some other data source (e.g. a 
>> non-JDBC-supported data source like MongoDB, Cassandra, etc.),
>> then you have to re-write your whole app. If you want to support
>> Websocket, then you have to completely re-write your webapp. If
>> you want to create an Android or Swing-based version, you have to
>> completely re-write your app. See the pattern here?
>> 
>> 
> I know existing design is somewhat a kind of limitation,but again
> at this point ,its just to hard to implement this change.
> 
> Let me think over this.It will take sometime.

There's no time like the present: this problem will only get worse
over time.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/rISAACgkQ9CaO5/Lv0PC8MwCeMVv+gx6x4ItxZspgJwI0e2km
458An0CPoRxJQBmh/AKRQFo4o64ByJZE
=eQp9
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-26 Thread Kiran Badi
Probably waited too long for a connection. What does your pool 
configuration look like? Look in META-INF/context.xml or, I suppose, in 
conf/server.xml for  elements.


 type="javax.sql.DataSource"

   maxActive="100" maxIdle="30" maxWait="1"
   username="user" password="xxx" 
driverClassName="com.mysql.jdbc.Driver"

   url="jdbc:mysql://localhost:3306/mysitedb"/>

This is my configuration in context.xml Chris.

 I had a bug in my code  and I was not closing connection, I fixed it 
and now this is working fine.

an architectural comment: it's probably not a great idea to
obtain a database connection directly from your Servlet. Doing so
likely ties your business logic directly to both the servlet API *and*
the JDBC API.

If you want to switch to some other data source (e.g. a
non-JDBC-supported data source like MongoDB, Cassandra, etc.), then
you have to re-write your whole app. If you want to support Websocket,
then you have to completely re-write your webapp. If you want to
create an Android or Swing-based version, you have to completely
re-write your app. See the pattern here?


I know existing design is somewhat a kind of limitation,but again at 
this point ,its just to hard to implement this change.


Let me think over this.It will take sometime.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-26 Thread Kiran Badi
On 6/26/2012 12:09 PM, Steven Sinclair wrote:
> You can use java jmx console to monitor the number of db connections.
Thanks Steven, I will check this.Actually servlet was leaking connection
and I had forgot to close connection.Fixed it now.

But I still need to monitor DB side.I will check jmx console.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kiran,

On 6/26/12 1:11 AM, Kiran Badi wrote:
> While testing the pagination links ,I am getting below error,
> 
> SEVERE: null org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot
> get a connection, pool error Timeout waiting for idle object

Probably waited too long for a connection. What does your pool
configuration look like? Look in META-INF/context.xml or, I suppose,
in conf/server.xml for  elements.

> at 
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114)
>
>  at 
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>
>  at 
> indianads.getServicesTourDetail.doGet(getServicesTourDetail.java:106)

Just
> 
an architectural comment: it's probably not a great idea to
obtain a database connection directly from your Servlet. Doing so
likely ties your business logic directly to both the servlet API *and*
the JDBC API.

If you want to switch to some other data source (e.g. a
non-JDBC-supported data source like MongoDB, Cassandra, etc.), then
you have to re-write your whole app. If you want to support Websocket,
then you have to completely re-write your webapp. If you want to
create an Android or Swing-based version, you have to completely
re-write your app. See the pattern here?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/qFD4ACgkQ9CaO5/Lv0PBh0QCgiXqoY7K4LhV2nKqlmTbG5bri
VPAAnjdS/a7ZF8CAoJ85VE+AoXMmDQ1q
=73J6
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection pool issue

2012-06-25 Thread Steven Sinclair
在 2012-6-26,13:11,Kiran Badi  写道:

> Hi All,
> 
> While testing the pagination links ,I am getting below error,
> 
> SEVERE: null
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool 
> error Timeout waiting for idle object
>at 
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114)
>at 
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>at indianads.getServicesTourDetail.doGet(getServicesTourDetail.java:106)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
>at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>at 
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
>at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> Was able to get connection
>at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
>at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
>at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
>at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
>at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
>at 
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
>at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
>at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
>at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
>at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
>at 
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>at java.lang.Thread.run(Thread.java:662)
> Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
>at 
> org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1144)
>at 
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
>... 24 more
> 
> Where should I look to see as how many connection are establised on the DB 
> side and how many I have still that I can use ?
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

You can use java jmx console to monitor the number of db connections.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: tomcat dbcp encryption

2012-03-28 Thread Filip Hanik (mailing lists)
Or pay a vendor to do it for you :)
http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.tc-server.2.6/admin/manual-encrypt-passwords.html



> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, March 28, 2012 10:25 AM
> To: Tomcat Users List
> Subject: Re: tomcat dbcp encryption
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Ognjen,
> 
> On 3/27/12 6:32 AM, Ognjen Blagojevic wrote:
> > 이재만,
> >
> > On 27.3.2012 9:54, 이재만 wrote:
> >> how do i encrypt my datasource's user and password  in server.xml
> >> ??
> >
> > Read this: http://wiki.apache.org/tomcat/FAQ/Password
> 
> No, he didn't like that answer last time, so he asked again :(
> 
> The answer, of course, is to use ZIP encryption or PGP/GPG. Good luck
> starting Tomcat after that, though.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk9zO2UACgkQ9CaO5/Lv0PDj0gCfY3mSJV/VYzhjk226RPeo617
> Q
> aGEAn2zXTsQayySY6txyRC16m9UOS2Id
> =+Tna
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat dbcp encryption

2012-03-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ognjen,

On 3/27/12 6:32 AM, Ognjen Blagojevic wrote:
> 이재만,
> 
> On 27.3.2012 9:54, 이재만 wrote:
>> how do i encrypt my datasource's user and password  in server.xml
>> ??
> 
> Read this: http://wiki.apache.org/tomcat/FAQ/Password

No, he didn't like that answer last time, so he asked again :(

The answer, of course, is to use ZIP encryption or PGP/GPG. Good luck
starting Tomcat after that, though.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9zO2UACgkQ9CaO5/Lv0PDj0gCfY3mSJV/VYzhjk226RPeo617Q
aGEAn2zXTsQayySY6txyRC16m9UOS2Id
=+Tna
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat dbcp encryption

2012-03-27 Thread Ognjen Blagojevic

이재만,

On 27.3.2012 9:54, 이재만 wrote:

how do i encrypt my datasource's user and password  in server.xml ??


Read this: http://wiki.apache.org/tomcat/FAQ/Password

-Ognjen


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat dbcp encrption

2012-03-27 Thread Mark Thomas
On 27/03/2012 08:53, 이재만 wrote:
> hello everybody...
> 
> somebody help me..please..
> 
> how do i encrypt my datasource's user and password  in server.xml ??

http://wiki.apache.org/tomcat/FAQ/Password

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat-dbcp interceptors

2011-11-11 Thread Daniel Mikusa
Stevo,

OK, in the context of tomcat-jdbc, your questions do make more sense.
Glad you were able to find the answers.

BTW, I would strongly recommend tomcat-jdbc over DBCP.  Been working
with it for a while and it's very nice.

Dan


On Fri, 2011-11-11 at 06:44 -0800, Stevo Slavić wrote:
> Hello Daniel,
> 
> You're right, commons-dbcp and tomcat-dbcp seem to be same, I missed
> tomcat-jdbc module which seems to provide extensions and judging by
> the pom (see [1]) it depends only on tomcat-juli. I found the answers
> at [2] and [3].
> 
> Thanks!
> 
> Regards,
> Stevo.
> 
> [1] 
> http://repo1.maven.org/maven2/org/apache/tomcat/tomcat-jdbc/7.0.22/tomcat-jdbc-7.0.22.pom
> [2] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
> [3] 
> http://vigilbose.blogspot.com/2009/03/apache-commons-dbcp-and-tomcat-jdbc.html
> 
> 
> On Fri, Nov 11, 2011 at 2:35 PM, Daniel Mikusa  wrote:
> >
> >
> >> 1) Can tomcat-dbcp be used outside of tomcat e.g. in non-web apps?
> >
> > Yes, but tomcat-dbcp is exactly the same as commons-dbcp.  You would
> > probably just want to use commons-dbcp.
> >
> >> 2) If yes, are all features available as when used within tomcat?
> >
> > It has the same feature set as commons-dbcp.
> >
> >  https://commons.apache.org/dbcp/
> >
> >> 3) Most importantly are custom interceptors supported when tomcat-dbcp
> >> is used outside tomcat?
> >> 4) Can custom interceptor influence/extend connection validation?
> >> Would like not only to configure validation query but also to add
> >> extra logic which would process result of the query.
> >> 5) Are there any examples, documentation, blog posts showing
> >> implementations of custom interceptors?
> >
> > I'm not exactly sure what you are referring to with regard to the
> > interceptors.  Which version of Tomcat are you using?  How are you
> > configuring this within Tomcat?
> >
> > Dan
> >
> >
> >
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


Re: tomcat-dbcp interceptors

2011-11-11 Thread Stevo Slavić
Hello Daniel,

You're right, commons-dbcp and tomcat-dbcp seem to be same, I missed
tomcat-jdbc module which seems to provide extensions and judging by
the pom (see [1]) it depends only on tomcat-juli. I found the answers
at [2] and [3].

Thanks!

Regards,
Stevo.

[1] 
http://repo1.maven.org/maven2/org/apache/tomcat/tomcat-jdbc/7.0.22/tomcat-jdbc-7.0.22.pom
[2] http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
[3] 
http://vigilbose.blogspot.com/2009/03/apache-commons-dbcp-and-tomcat-jdbc.html


On Fri, Nov 11, 2011 at 2:35 PM, Daniel Mikusa  wrote:
>
>
>> 1) Can tomcat-dbcp be used outside of tomcat e.g. in non-web apps?
>
> Yes, but tomcat-dbcp is exactly the same as commons-dbcp.  You would
> probably just want to use commons-dbcp.
>
>> 2) If yes, are all features available as when used within tomcat?
>
> It has the same feature set as commons-dbcp.
>
>  https://commons.apache.org/dbcp/
>
>> 3) Most importantly are custom interceptors supported when tomcat-dbcp
>> is used outside tomcat?
>> 4) Can custom interceptor influence/extend connection validation?
>> Would like not only to configure validation query but also to add
>> extra logic which would process result of the query.
>> 5) Are there any examples, documentation, blog posts showing
>> implementations of custom interceptors?
>
> I'm not exactly sure what you are referring to with regard to the
> interceptors.  Which version of Tomcat are you using?  How are you
> configuring this within Tomcat?
>
> Dan
>
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat-dbcp interceptors

2011-11-11 Thread Daniel Mikusa


> 1) Can tomcat-dbcp be used outside of tomcat e.g. in non-web apps?

Yes, but tomcat-dbcp is exactly the same as commons-dbcp.  You would
probably just want to use commons-dbcp.

> 2) If yes, are all features available as when used within tomcat?

It has the same feature set as commons-dbcp.

  https://commons.apache.org/dbcp/

> 3) Most importantly are custom interceptors supported when tomcat-dbcp
> is used outside tomcat?
> 4) Can custom interceptor influence/extend connection validation?
> Would like not only to configure validation query but also to add
> extra logic which would process result of the query.
> 5) Are there any examples, documentation, blog posts showing
> implementations of custom interceptors?

I'm not exactly sure what you are referring to with regard to the
interceptors.  Which version of Tomcat are you using?  How are you
configuring this within Tomcat?

Dan




RE: Tomcat DBCP

2010-07-01 Thread Caldarale, Charles R
> From: Bill Davidson [mailto:bill...@gmail.com]
> Subject: Re: Tomcat DBCP
> 
> If we don't want to buy SpringSource tc, do we need to check 
> it out from SVN and build it?

Not sure what the official status of the package is right now, but you can get 
it here:

http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/
http://svn.apache.org/repos/asf/tomcat/trunk/modules/jdbc-pool/

You definitely do not have to pay for it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP

2010-07-01 Thread Mark Thomas

On 01/07/2010 23:31, Bill Davidson wrote:

On 6/9/2010 2:15 AM, Altanis Alexandros wrote:
 >I have been reading about the new Tomcat DBCP in a couple of blogs
 >lately, as I am interested in Connection Pooling for an application I am
 >working on. Here they are:
 >
 >http://vigilbose.blogspot.com/2009/03/apache-commons-dbcp-and-tomcat-jdbc.html
 
>http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency
 >http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

(I'm a little behind on the list, and trying to catch up)

Interesting. I was not aware of this other connection pool for Tomcat.
I'd be very interested in finding something faster than DBCP, which I
have found disappointing (I've got a lot of concurrency going on my
servers).

Based upon those links, it appears that you have to get the SpringSource
tc server to get the pool? Is this is a SpringSource commercial (not free)
product? That would explain why I don't see any mention of it in the
regular Tomcat docs.

As near as I can figure, it isn't part of the Apache Foundation site. That
last link makes it look like it's part of Tomcat 7, but from what I can
tell,
it is not.

If it is available free, then what is the appropriate method of getting
it? If
we don't want to buy SpringSource tc, do we need to check it out from
SVN and build it? I can't find a normal home page for it.


It is an unreleased module in trunk. You have to build it from source.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP

2010-07-01 Thread Bill Davidson

On 6/9/2010 2:15 AM, Altanis Alexandros wrote:
>I have been reading about the new Tomcat DBCP in a couple of blogs
>lately, as I am interested in Connection Pooling for an application I am
>working on. Here they are:
>
>http://vigilbose.blogspot.com/2009/03/apache-commons-dbcp-and-tomcat-jdbc.html
>http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency
>http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html

(I'm a little behind on the list, and trying to catch up)

Interesting.  I was not aware of this other connection pool for Tomcat.
I'd be very interested in finding something faster than DBCP, which I
have found disappointing (I've got a lot of concurrency going on my
servers).

Based upon those links, it appears that you have to get the SpringSource
tc server to get the pool?  Is this is a SpringSource commercial (not free)
product?  That would explain why I don't see any mention of it in the
regular Tomcat docs.

As near as I can figure, it isn't part of the Apache Foundation site.  That
last link makes it look like it's part of Tomcat 7, but from what I can 
tell,

it is not.

If it is available free, then what is the appropriate method of getting 
it?  If

we don't want to buy SpringSource tc, do we need to check it out from
SVN and build it?  I can't find a normal home page for it.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP

2010-06-10 Thread Mark Thomas
On 10/06/2010 08:25, Altanis Alexandros wrote:
> Thanks! 
> 
> However, when I try to checkout the repository, I get 
> 
> "Repository moved permanently to
> '/viewvc/tomcat/trunk/modules/jdbc-pool/';"
> 
> I had to use 
> 
> http://svn.apache.org/repos/asf/tomcat/trunk/modules/jdbc-pool/
> 
> in order to checkout. 
> 
> Thanks again!

Sorry. My bad. I gave you the url for the viewer not the actual svn
checkout. The url you are using is the correct one.

Mark


> 
> Alexander
> 
> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org] 
> Sent: Wednesday, June 09, 2010 1:31 PM
> To: Tomcat Users List
> Subject: Re: Tomcat DBCP
> 
> On 09/06/2010 10:15, Altanis Alexandros wrote:
>> My question is this: can I use this feature with Tomcat 6?
> 
> Yes.
> 
>> Where can I get a hold of the source code? I found some svn
>> links that point to 404. 
> http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/
> 
> Mark
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat DBCP

2010-06-10 Thread Altanis Alexandros
Thanks! 

However, when I try to checkout the repository, I get 

"Repository moved permanently to
'/viewvc/tomcat/trunk/modules/jdbc-pool/';"

I had to use 

http://svn.apache.org/repos/asf/tomcat/trunk/modules/jdbc-pool/

in order to checkout. 

Thanks again! 

Alexander

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Wednesday, June 09, 2010 1:31 PM
To: Tomcat Users List
Subject: Re: Tomcat DBCP

On 09/06/2010 10:15, Altanis Alexandros wrote:
> My question is this: can I use this feature with Tomcat 6?

Yes.

> Where can I get a hold of the source code? I found some svn
> links that point to 404. 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/

Mark




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP

2010-06-09 Thread Mark Thomas
On 09/06/2010 10:15, Altanis Alexandros wrote:
> My question is this: can I use this feature with Tomcat 6?

Yes.

> Where can I get a hold of the source code? I found some svn
> links that point to 404. 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP : testOnBorrow not working (?)

2010-03-10 Thread Konstantin Kolinko
2010/3/10 José Paumard :
> To be sure that DBCP is not providing closed connections to Hibernate, I
> added the following to the Resource element, but with no success : (...)

Note, that META-INF/context.xml of a web application is copied to
${catalina.base}/conf/Catalina/localhost/.xml
when your application is deployed on Tomcat.

(the path will be different if you have different Service and Host
names. The above ones are the defaults).

Look there and make sure that your updates to context.xml were picked
up by Tomcat.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yagnesh,

On 11/18/2009 1:32 AM, Yagnesh Chawda wrote:
>   There is no difference in the outcome when I use "com.mysql.jdbc.Driver"
> 
>max_connections=200 is still same in MySQL.

That is very strange.

Can you try to configure the data source through Tomcat (that is, using
a  element in your context.xml file) to see if it's the
connection pool or if Spring is doing something behind the scenes?

You could just code-up a simple JSP that does some database access using
the DataSource that Tomcat configures and run a simple JMeter test
against that. Don't bother deploying your own webapp because it will
just make things more confusing.

It's possible that Spring is doing something strange, here.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksEGuQACgkQ9CaO5/Lv0PDvHgCfTKIs4e7FUzslV+H86RElPE43
2i0AoKRwThEAY2gIuzEpVZ8NrLKFSLbA
=BKur
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-17 Thread Yagnesh Chawda

Hi,
  There is no difference in the outcome when I use "com.mysql.jdbc.Driver"

   max_connections=200 is still same in MySQL. I confirmed that MySQL is
able to handle that much load by running JMeter load testing which causes my
application to create even 95 connection if I set "maxActive" connections in
my pool  = 95. BUt problem is that with each HTTP request from JMeter, if
pool is creating new connection to MySQL as only 8-9 connections are
available in pool. And pool drops connection immediately after serving that
request.
  I hope that I have told you that, pool attempts to create "initialSize"
number of connections to the MySQL server. But it also drops it off
immediately in a second or two, leaving behind only 8-9 pooled connection.



Christopher Schultz-2 wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Yagnesh,
> 
> On 11/17/2009 10:51 AM, Yagnesh Chawda wrote:
>>   Thanks for reply. I had tried using "com.mysql.jdbc.Driver" as well
>> earlier. But no luck :(
> 
> What does happen when you use com.mysql.jdbc.Driver?
> 
> What are the current values for max_connections and max_user_connections
> in MySQL? I know you said you set max_connections=200 but I just wanted
> to make sure that MySQL actually has that setting while it's running.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAksDG/IACgkQ9CaO5/Lv0PBc0wCgq7YxJdaIHiCbiKUTwngX99QI
> gqoAoL9T9Yw4WR4NXF8gDbC/F6KyDZ1F
> =YvGV
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26402989.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yagnesh,

On 11/17/2009 10:51 AM, Yagnesh Chawda wrote:
>   Thanks for reply. I had tried using "com.mysql.jdbc.Driver" as well
> earlier. But no luck :(

What does happen when you use com.mysql.jdbc.Driver?

What are the current values for max_connections and max_user_connections
in MySQL? I know you said you set max_connections=200 but I just wanted
to make sure that MySQL actually has that setting while it's running.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksDG/IACgkQ9CaO5/Lv0PBc0wCgq7YxJdaIHiCbiKUTwngX99QI
gqoAoL9T9Yw4WR4NXF8gDbC/F6KyDZ1F
=YvGV
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-17 Thread Yagnesh Chawda

Hi Chris,
  Thanks for reply. I had tried using "com.mysql.jdbc.Driver" as well
earlier. But no luck :(



Christopher Schultz-2 wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Yagnesh,
> 
> On 11/17/2009 12:32 AM, Yagnesh Chawda wrote:
>>  Thanks Chris, That was just a typo. Thanks for pointing it out. But in
>> real
>> configuration was was not commented. It was some other config which I was
>> trying and forgot to uncomment it in posting.
> 
> Ok.
> 
>> >   class="org.apache.commons.dbcp.BasicDataSource">
>>  >value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
> 
> I find it unusual that you'd be using a DataSource as the driver class
> name. Typically, for MySQL, you'd use com.mysql.jdbc.Driver as the class
> name, not the MySQL-supplied DataSource as the driver class name.
> 
> Other than that, I would expect your connection pool to always have a
> minimum of 35 connections sitting idle in it, even when your site was
> seeing no traffic.
> 
> I wonder if the problem is that you appear to be using two data sources
> instead of one data source and one JDBC driver.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAksCvlgACgkQ9CaO5/Lv0PCNRQCgwqSmsc1EUj7aCxh1hGhGjImC
> 7IIAnjC4PQCrSepnOuMUvAcAIAQy8Kia
> =8Fl9
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26392261.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yagnesh,

On 11/17/2009 12:32 AM, Yagnesh Chawda wrote:
>  Thanks Chris, That was just a typo. Thanks for pointing it out. But in real
> configuration was was not commented. It was some other config which I was
> trying and forgot to uncomment it in posting.

Ok.

>class="org.apache.commons.dbcp.BasicDataSource">
>   value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
>   
>   
>   
>   
>   
>   
>   
>   

I find it unusual that you'd be using a DataSource as the driver class
name. Typically, for MySQL, you'd use com.mysql.jdbc.Driver as the class
name, not the MySQL-supplied DataSource as the driver class name.

Other than that, I would expect your connection pool to always have a
minimum of 35 connections sitting idle in it, even when your site was
seeing no traffic.

I wonder if the problem is that you appear to be using two data sources
instead of one data source and one JDBC driver.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksCvlgACgkQ9CaO5/Lv0PCNRQCgwqSmsc1EUj7aCxh1hGhGjImC
7IIAnjC4PQCrSepnOuMUvAcAIAQy8Kia
=8Fl9
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Yagnesh Chawda

Hey,
 Thanks Chris, That was just a typo. Thanks for pointing it out. But in real
configuration was was not commented. It was some other config which I was
trying and forgot to uncomment it in posting.



Christopher Schultz-2 wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Yagnesh,
> 
> On 11/16/2009 9:09 AM, Yagnesh Chawda wrote:
>>  My bean definition is as follows for DBCP:
>> 
>> > class="org.apache.commons.dbcp.BasicDataSource">
>>  
>>  
> 
> Your bean appears to be almost entirely commented-out. Is this your real
> configuration?
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAksCE8cACgkQ9CaO5/Lv0PDaRQCfWQPncqd/ykRg9AD4M43ag8FJ
> UKkAn0sSdb3b/pUDp9RDDV9KJG1noqys
> =MAA7
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26384679.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yagnesh,

On 11/16/2009 9:09 AM, Yagnesh Chawda wrote:
>  My bean definition is as follows for DBCP:
> 
>  class="org.apache.commons.dbcp.BasicDataSource">
>   
>   

Your bean appears to be almost entirely commented-out. Is this your real
configuration?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksCE8cACgkQ9CaO5/Lv0PDaRQCfWQPncqd/ykRg9AD4M43ag8FJ
UKkAn0sSdb3b/pUDp9RDDV9KJG1noqys
=MAA7
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Mark Thomas
Peter Crowther wrote:
> 2009/11/16 Pid :
>> You managed to subscribe to the list, can't you follow the instructions on
>> how to unsubscribe?  Clues at the bottom of every email.
> 
> We keep saying that, and it keeps being a problem for users.
> 
> The email-based unsubscribe appears to be unreliable, I suspect due to
> an overzealous spam filter being applied to messages arriving at it.
> I don't know whether it's possible to implement an alternative web
> form-based approach that mails the user to confirm the unsubscribe,
> but allows the user to paste a verify code into the unsubscribe page
> so that they never have to email the Apache list server.

It is clear that Evan is sending e-mail in HTML. That is almost enough on it's
own to trigger the spam filter and most e-mails manage to trigger a couple more
rules to push the score over the threshold.

I thought that spam filtering on unsubscribe addresses had been disabled. I'll
check that and if it hasn't see what can be done in that direction.

I note that there has been zero communication from Evan to the list owner. I'll
also note that the time it takes one of the list owners to unsubscribe someone
who complains to the list tends to be directly proportional to the rudeness of
the message. Given the tone of Evan's message I don't feel any great urge to
help him any time soon.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Peter Crowther
2009/11/16 Pid :
> You managed to subscribe to the list, can't you follow the instructions on
> how to unsubscribe?  Clues at the bottom of every email.

We keep saying that, and it keeps being a problem for users.

The email-based unsubscribe appears to be unreliable, I suspect due to
an overzealous spam filter being applied to messages arriving at it.
I don't know whether it's possible to implement an alternative web
form-based approach that mails the user to confirm the unsubscribe,
but allows the user to paste a verify code into the unsubscribe page
so that they never have to email the Apache list server.

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Pid

On 16/11/2009 14:12, Evan Siegel wrote:

UNSUBSCRIBE ME!
I have been emailing you guys for over a week to unsubcribe me.

> PLEASE CEASE AND DESIST FROM SENDING ME MORE MAILINGS FROM THIS LIST!

"You guys"?  There's only one email from you, that I can see to this 
list, which is this one.  So... ?


You managed to subscribe to the list, can't you follow the instructions 
on how to unsubscribe?  Clues at the bottom of every email.



p



Please visit our websites at
http://www.geocities.com/evan_j_siegel'>http://www.geocities.com/evan_j_siegel";>http://www.geocities.com/evan_j_siegel
and
http://www.qlineorientalist.com/IranRises'>http://www.qlineorientalist.com/IranRises";>http://www.qlineorientalist.com/IranRises
Thank you.





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat DBCP Connection Pooling to MySQL limited number of connection issue in Spring2.5 + Hibernate3 + commons-DBCP1.2

2009-11-16 Thread Evan Siegel
UNSUBSCRIBE ME!
I have been emailing you guys for over a week to unsubcribe me. PLEASE CEASE 
AND DESIST FROM SENDING ME MORE MAILINGS FROM THIS LIST!

 
Please visit our websites at
http://www.geocities.com/evan_j_siegel'>http://www.geocities.com/evan_j_siegel";>http://www.geocities.com/evan_j_siegel
and
http://www.qlineorientalist.com/IranRises'>http://www.qlineorientalist.com/IranRises";>http://www.qlineorientalist.com/IranRises
Thank you.





From: Yagnesh Chawda 
To: users@tomcat.apache.org
Sent: Mon, November 16, 2009 9:09:51 AM
Subject: Tomcat DBCP Connection Pooling to MySQL limited number of connection 
issue in Spring2.5 + Hibernate3 + commons-DBCP1.2


Hi,
  I am using Spring 2.5, Hibernate 3 and MySQL (5.0.45 (32 Bit), 5.0.84(64
Bit)) with commons-DBCP 1.2 in Tomcat-5.5

My issue is that even after specifying Connection pool of initialSize=40
and minIdle=35, my App. server is never keep only 9 connections open under
zero load condition. What I could figure out from the MySQL log was that,
server did created 40 connections, but also dropped each connection in 1-2
seconds after connection started. I have max_connection=200 in MySQL, and
time to keep idle connection in MySQL is also 8Hrs. 
  
Under load, App server creates connections upto 95 as I have described
it as maxActive=95
I confirmed it thru "show global status" and "show processlist" on MySQL
prompt while simulating a heavy traffic thru JMeter.

I tried with c3p0 from Hibernate, but no luck. Outcome is exactly same.
So am wondering what the issue is ??

My bean definition is as follows for DBCP:










   


   
   
 com.domain.Company
 com.domain.Country
   
   
   

false
false
org.hibernate.dialect.MySQLDialect
org.hibernate.transaction.JDBCTransactionFactory

org.hibernate.cache.EhCacheProvider
my-ehcache.xml
true
true
true
30
30
true
true
auto

   


-- 
View this message in context: 
http://old.nabble.com/Tomcat-DBCP-Connection-Pooling-to-MySQL-limited-number-of-connection-issue-in-Spring2.5-%2B-Hibernate3-%2B-commons-DBCP1.2-tp26372475p26372475.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

Re: Tomcat DBCP: Getting java.sql.SQLException: Closed Statement

2009-05-06 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ashoknan,

On 5/6/2009 5:43 PM, ashoknan wrote:
> This app was running fine in Weblogic but after migrating to Tomcat
> 6+ DBCP we are seeing the below exception.

Which version of TC 6 are you using? Are you using the stock DBCP or
Filip's new-fangled DBCP?

> We also looked our code base for any threading or concurrency issues..we
> were not able spot any issues. 

Famous last words.

> I have observed one more thing..why checkOpen in DelegatingPreparedStatement
> didn't catch this but OracleStatement thinks the statement is closed.

What makes you say that DelegatingPreparedStatement.checkOpen is being
called and seeing an incorrect state?

I suspect you (or the Spring folks?) are unwrapping the pooled statement
at some point to expose its Oracle-ness, and then you are (incorrectly)
closing the underlying statement instead of closing the wrapping
(pooled) statement as you should be.

> org.springframework.jdbc.object.SqlUpdate.update(SqlUpdate.java:168) 
> at
> com.dao.DealXAuditTrailDaoBase.insertDealXAuditTrailVoBase(Unknown Source) 

This code (yours?) is calling SqlUpdate.update. What does your code look
like around here? Are you using any transactions?

> at com.deal.DealTO.insertAuditTrail(DealTO.java:183) 
> at com.deal.DealTO.processAuditTrail(DealTO.java:168) 
> at com.deal.DealTO.update(DealTO.java:110) 

The code around here might be useful to see, too.

> validationQuery="select count(*) from dual"/> 

That's a weird one.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkoCRHkACgkQ9CaO5/Lv0PD01gCdH7IHL1q8iXbTmRp9HVyciRNi
wJQAnjvN+vEcyoW7TWOGnD0G04506cCO
=aFGJ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat-dbcp from Maven

2007-05-21 Thread Filip Hanik - Dev Lists
the maven jars/upload is still in process, if you want to contribute 
help, take a look at res/maven in the tomcat 6 tree


Filip

lightbulb432 wrote:

The tomcat-dbcp library doesn't seem to be available from the Maven
repository for Tomcat at http://tomcat.apache.org/dev/dist/m2-repository or
repo1.maven.org...am I just missing another maven repository that I should
be looking at, or must I manually install this JAR into my own local
repository?

Also, when will the latest version of the JARs (later than 6.0.10) be
uploaded to the repository at
http://tomcat.apache.org/dev/dist/m2-repository - what's the process for
deciding when it's appropriate to upload Tomcat releases to the Maven
repositories for Tomcat?

Thanks.
  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat / DBCP / Oracle / Reconnect

2007-01-18 Thread Krishna Paparaju
I could make this work with 'validationQuery' parameter. 

Thanks


-Original Message-
From: Mark Thomas [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 18, 2007 7:08 PM
To: Tomcat Users List
Subject: Re: Tomcat / DBCP / Oracle / Reconnect

Krishna Paparaju wrote:
> I am trying to find is there anyway Tomcat can be configured to
> reconnect back to DB once it is up. I know autoReconnect flag works
for
> mySQL. Is there any equivalent in Oracle/thin driver?

You could use testOnBorrow="true" and a validationQuery to achieve
this. Check the docs for DBCP for details on how to configure this.

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat / DBCP / Oracle / Reconnect

2007-01-18 Thread Mark Thomas
Krishna Paparaju wrote:
> I am trying to find is there anyway Tomcat can be configured to
> reconnect back to DB once it is up. I know autoReconnect flag works for
> mySQL. Is there any equivalent in Oracle/thin driver?

You could use testOnBorrow="true" and a validationQuery to achieve
this. Check the docs for DBCP for details on how to configure this.

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat / DBCP / Oracle / Reconnect

2007-01-18 Thread Mark Thomas
When starting a new thread (ie sending a message to the list about a
new topic) please do not reply to an existing message and change the
subject line. To many of the list archiving services and mail clients
used by list subscribers this  makes your new message appear as part
of the old thread. This makes it harder for other users to find
relevant information when searching the lists.

This is known as thread hijacking and is behaviour that is frowned
upon on this list. Frequent offenders will be removed from the list.
It should also be noted that many list subscribers automatically
ignore any messages that hijack another thread.

The correct procedure is to create a new message with a new subject.
This will start a new thread.

Mark
tomcat-user-owner

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]