Re: Jdbc drivers not found on Tomcat 10

2022-01-06 Thread hantsy bai
HI Christopher, not sure we are on the same page. The problem I encountered
was that a Spring 6 war app with pg driver(42.3.1) could not deploy on
Tomcat 10, but worked well when downupgraded to Spring 5/Tomcat 9.  But on
the jetty 11 and WildFly preview 26, Spring 6/pg war package are also
working.
I checked the source code of Spring DriverMangerDataSource, it will search
the drivers when calling getConnection at the first time, the work is
delegated to the underlay DriverManager class. There is a security check
wrapping the operations, not sure this affects the actions on Tomcat 10.

Regards,

*Hantsy Bai*

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy
Medium: https://medium.com/@hantsy


On Fri, Jan 7, 2022 at 12:42 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Hantsy,
>
> On 1/5/22 23:31, hantsy bai wrote:
> > I finally resolved this issue. Exclude the pg driver from war, and copy
> it
> > to tomcat/lib, it works.
> >
> > I remember in the past years,  I preferred tomcat for Java Web
> applications
> > because I did not need to register a Jdbc driver but  it is tedious work
> in
> > Java EE application servers, such as Glassfish, etc. But since Java EE 7,
> > it supports packaging Jdbc drivers into war and register it automatically
> > when deploying the application to the application servers.
> >
> > What happened in the tomcat classloader and war application classloader
> of
> > Tomcat 10?
>
> They still exist. The detailed answer to your question is on Stack
> Overflow. What about that answer do you not understand? It explains what
> you would need to do in order to get the driver to work when placed in
> your WAR bundle.
>
> The problem is not Tomcat; the problem is the way that DriverManager
> works, and Tomcat has no control over that.
>
> -chris
>
> > On Mon, Jan 3, 2022 at 12:02 PM hantsy bai  wrote:
> >
> >> I have tried to update myself  Spring 6/Jakarta EE9/Java 17, etc, and
> >> created a simple war application, when deployed to Tomcat 10, failed,
> due
> >> to the famous *no suitable drivers*.
> >>
> >> I have created a detailed post on stackoverflow:
> >>
> >>
> >>
> https://stackoverflow.com/questions/70554119/no-suitable-drivers-available-when-deploying-a-spring-6-war-to-tomcat-10
> >>
> >> Any suggestion is welcome.
> >> Thanks.
> >>
> >> *Hantsy Bai*
> >>
> >> Self-employed consultant, fullstack developer, agile coach
> >>
> >> GitHub: https://github.com/hantsy
> >>
> >> Twitter: https://twitter.com/@hantsy
> >> Medium: https://medium.com/@hantsy
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Jdbc drivers not found on Tomcat 10

2022-01-06 Thread Christopher Schultz

Hantsy,

On 1/5/22 23:31, hantsy bai wrote:

I finally resolved this issue. Exclude the pg driver from war, and copy it
to tomcat/lib, it works.

I remember in the past years,  I preferred tomcat for Java Web applications
because I did not need to register a Jdbc driver but  it is tedious work in
Java EE application servers, such as Glassfish, etc. But since Java EE 7,
it supports packaging Jdbc drivers into war and register it automatically
when deploying the application to the application servers.

What happened in the tomcat classloader and war application classloader of
Tomcat 10?


They still exist. The detailed answer to your question is on Stack 
Overflow. What about that answer do you not understand? It explains what 
you would need to do in order to get the driver to work when placed in 
your WAR bundle.


The problem is not Tomcat; the problem is the way that DriverManager 
works, and Tomcat has no control over that.


-chris


On Mon, Jan 3, 2022 at 12:02 PM hantsy bai  wrote:


I have tried to update myself  Spring 6/Jakarta EE9/Java 17, etc, and
created a simple war application, when deployed to Tomcat 10, failed, due
to the famous *no suitable drivers*.

I have created a detailed post on stackoverflow:


https://stackoverflow.com/questions/70554119/no-suitable-drivers-available-when-deploying-a-spring-6-war-to-tomcat-10

Any suggestion is welcome.
Thanks.

*Hantsy Bai*

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy
Medium: https://medium.com/@hantsy





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



Re: Jdbc drivers not found on Tomcat 10

2022-01-05 Thread hantsy bai
I finally resolved this issue. Exclude the pg driver from war, and copy it
to tomcat/lib, it works.

I remember in the past years,  I preferred tomcat for Java Web applications
because I did not need to register a Jdbc driver but  it is tedious work in
Java EE application servers, such as Glassfish, etc. But since Java EE 7,
it supports packaging Jdbc drivers into war and register it automatically
when deploying the application to the application servers.

What happened in the tomcat classloader and war application classloader of
Tomcat 10?

*Hantsy Bai*

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy
Medium: https://medium.com/@hantsy


On Mon, Jan 3, 2022 at 12:02 PM hantsy bai  wrote:

> I have tried to update myself  Spring 6/Jakarta EE9/Java 17, etc, and
> created a simple war application, when deployed to Tomcat 10, failed, due
> to the famous *no suitable drivers*.
>
> I have created a detailed post on stackoverflow:
>
>
> https://stackoverflow.com/questions/70554119/no-suitable-drivers-available-when-deploying-a-spring-6-war-to-tomcat-10
>
> Any suggestion is welcome.
> Thanks.
>
> *Hantsy Bai*
>
> Self-employed consultant, fullstack developer, agile coach
>
> GitHub: https://github.com/hantsy
>
> Twitter: https://twitter.com/@hantsy
> Medium: https://medium.com/@hantsy
>


RE: jdbc connction pool issues [EXTERNAL]

2020-12-18 Thread Beard, Shawn
Yeah I didn’t consider that relevant at the time. All examples of creating a 
jdbc connection pool for SQL server on tomcat did not have specifying the 
factory in them. So I didn’t consider it relevant. My bad.

​

Shawn   Beard• Sr. Systems Engineer

Middleware Engineering

[cid:image095582.png@B63DE6DB.090F1975]
3840 109th Street   ,   Urbandale   ,   IA  50322

Phone: +1-515-564-2528
Email:  sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

Website: https://berkleytechnologyservices.com/




[cid:image070627.jpg@9AB92315.41952739]

Technology Leadership Unleashing Business Potential









-Original Message-
From: Christopher Schultz 
Sent: Friday, December 18, 2020 7:22 AM
To: Tomcat Users List 
Subject: Re: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Shawn,

On 12/17/20 14:21, Beard, Shawn wrote:
> Well the other tomcat servers had a custom factory specified. That was
> the only difference. (devs wrote their own library for it)
So they were different. It's always misleading when getting a report like this:

On 12/15/20 15:35, Beard, Shawn wrote:
> Other tomcat servers with exact same jdbc connection pool config(only
> difference is servername, databasename, user and pass) show 50 max
> connections, which is what maxActive is set to.
So you can see why we were maybe confused about what was happening.

-chris

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

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.


Re: jdbc connction pool issues [EXTERNAL]

2020-12-18 Thread Christopher Schultz

Shawn,

On 12/17/20 14:21, Beard, Shawn wrote:

Well the other tomcat servers had a custom factory specified. That
was the only difference. (devs wrote their own library for it)

So they were different. It's always misleading when getting a report
like this:

On 12/15/20 15:35, Beard, Shawn wrote:
Other tomcat servers with exact same jdbc connection pool 
config(only difference is servername, databasename, user and pass)

show 50 max connections, which is what maxActive is set to.

So you can see why we were maybe confused about what was happening.

-chris

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



RE: jdbc connction pool issues [EXTERNAL]

2020-12-17 Thread Beard, Shawn
Well the other tomcat servers had a custom factory specified. That was the only 
difference. (devs wrote their own library for it)
So I looked in tomcat documentation and tried loading a out of the box factory 
that was available. That’s when it was picking up the maxActive setting and I 
started seeing that setting properly reflected in JMX.

​

Shawn   Beard• Sr. Systems Engineer

Middleware Engineering

[cid:image952388.png@65A378B2.7242AA8D]
3840 109th Street   ,   Urbandale   ,   IA  50322

Phone: +1-515-564-2528
Email:  sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

Website: https://berkleytechnologyservices.com/




[cid:image151023.jpg@DFE8510C.41F52B48]

Technology Leadership Unleashing Business Potential









-Original Message-
From: Christopher Schultz 
Sent: Thursday, December 17, 2020 1:02 PM
To: users@tomcat.apache.org
Subject: Re: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Shawn,

On 12/17/20 11:04, Beard, Shawn wrote:
> I was able to fix this. I added this to the config:
>
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
>
> I was then seeing maxConnections of 50 in jmx and not 8.

So Phil was right: you needed to s/maxActive/maxTotal/.

That doesn't sounds right if "all your other servers are working with the same 
config and Tomcat version" so something isn't right about that statement. 
*Something* is different.

Switching to the Tomcat jdbc-pool again uses "maxActive" instead of "maxTotal" 
as the configuration option for the largest number of connections allowed in 
the pool, which is why it works when you change it.

-chris

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

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.


Re: jdbc connction pool issues [EXTERNAL]

2020-12-17 Thread Christopher Schultz

Shawn,

On 12/17/20 11:04, Beard, Shawn wrote:

I was able to fix this. I added this to the config:

factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

I was then seeing maxConnections of 50 in jmx and not 8.


So Phil was right: you needed to s/maxActive/maxTotal/.

That doesn't sounds right if "all your other servers are working with 
the same config and Tomcat version" so something isn't right about that 
statement. *Something* is different.


Switching to the Tomcat jdbc-pool again uses "maxActive" instead of 
"maxTotal" as the configuration option for the largest number of 
connections allowed in the pool, which is why it works when you change it.


-chris

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



RE: jdbc connction pool issues [EXTERNAL]

2020-12-17 Thread Beard, Shawn
I was able to fix this. I added this to the config:

factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

I was then seeing maxConnections of 50 in jmx and not 8.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Beard, Shawn 
Sent: Wednesday, December 16, 2020 7:43 AM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Yes same version of tomcat 9.0.31, however the one having issues is running 
java 8 where the one that shows things correctly is running java 11.



Shawn​ Beard

Sr. Systems Engineer |
BTS

Middleware Engineering | +1-515-564-2528 | 
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Phil Steitz 
Sent: Tuesday, December 15, 2020 3:37 PM
To: users@tomcat.apache.org
Subject: Re: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


On 12/15/20 1:35 PM, Beard, Shawn wrote:
> No intitialSize is not defined.
>
> Im getting the data to verify from JMX, however we also have an APM called 
> appdynamics loaded. Both verified the 8 max connections.
>
> Other tomcat servers with exact same jdbc connection pool config(only 
> difference is servername, databasename, user and pass) show 50 max 
> connections, which is what maxActive is set to.

Are the other tomcat servers running the same tomcat version? Since TC8, the 
default connection pool is DBCP2 which uses maxTotal in place of maxActive. See 
[1]. If you are running 8+, s/maxActive/maxTotal in the config should work.

Phil

[1] 
https://urldefense.com/v3/__https://tomcat.apache.org/migration-8.html*Database_Connection_Pooling__;Iw!!Li8W9_Um1Taa!orxL7Ci-tTj7jM-90ooXXY8VTcDfIzFLc9YZw4Oh-ybxGw-BbIQv4_O0_vGUlXfF$

>
>
>
> Shawn​ Beard
>
> Sr. Systems Engineer |
> BTS
>
> Middleware Engineering | +1-515-564-2528 |
> sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
>
>
>
>
>
>
>
>
>
> -Original Message-----
> From: Johnson, Jim 
> Sent: Tuesday, December 15, 2020 2:22 PM
> To: Tomcat Users List 
> Subject: RE: jdbc connction pool issues [EXTERNAL]
>
> ** CAUTION: External message
>
>
> Hi Shawn,
>
> No, I don't think that maxActive means that it's defining the maximum
> number of connections for the pool, I think it's strictly referring to
> the "[ .. ] maximum number of *active connections* that can be
> allocated from this pool at the same time. [ .. ]" (emphasis mine on
> active connections)
>
> Here is the doc that I've been referring to - sorry for not linking it 
> earlier:
> https://urldefense.com/v3/__https://tomcat.apache.org/tomcat-9.0-doc/j
> dbc-pool.html__;!!Li8W9_Um1Taa!vJGrxr7yc86joO5r6QoNstpipfempGFqrYRe3_N
> yAIGNs-LenmBWhtjn1fRiAOex$
>
> On those other Tomcat servers is there a initialSize defined?
>
> Jim
>
> -Original Message-
> From: Beard, Shawn 
> Sent: Tuesday, December 15, 2020 2:49 PM
> To: Tomcat Users List 
> Subject: RE: jdbc connction pool issues [EXTERNAL]
>
> But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? 
> On other tomcat servers I have, maxActive is set to 50 and I verified im jmx 
> that there are 50 max connections on the connection pool.
>
> Here though I checked jmx, sure enough, its max connections is 8.
>
>
>
> Shawn​ Beard
>
> Sr. Systems Engineer |
> BTS
>
> Middleware Engineering | +1-515-564-2528 |
> sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
>
>
>
>
>
>
>
>
>
> -Original Message-
> From: Johnson, Jim 
> Sent: Tuesday, December 15, 2020 1:35 PM
> To: Tomcat Users List 
> Subject: RE: jdbc connction pool issues [EXTERNAL]
>
> ** CAUTION: External message
>
>
> Hi Shawn,
>
> I think you’re missing initialSize
>
> initialSize
> (int)The initial number of connections that are created when the pool
> is started. Default value is 10
>
> maxActive
> (int) The maximum number of active connections that can be allocated
> from this pool at the same time. The default value is 100
>
> It would make sense that 8 connections would be 80% utilized.
>
> I would try replacing maxActive with initialSize and seeing how that works 
> for you.
>
> Good luck!
>
> - Jim
>
> From: Beard, Shawn 
> Sent: Tuesday, December 15, 2020 2:12 PM
> To: Tomcat Users List 
> Subject: jdbc connction pool issues
>
> CAUTION EXTERNAL EMAIL: This email originated from outside of the 
> organization. Do not click links or open attachments unless you recognize the 
> sender and know the content is safe.
>

RE: jdbc connction pool issues [EXTERNAL]

2020-12-16 Thread Beard, Shawn
Yes same version of tomcat 9.0.31, however the one having issues is running 
java 8 where the one that shows things correctly is running java 11.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Phil Steitz 
Sent: Tuesday, December 15, 2020 3:37 PM
To: users@tomcat.apache.org
Subject: Re: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


On 12/15/20 1:35 PM, Beard, Shawn wrote:
> No intitialSize is not defined.
>
> Im getting the data to verify from JMX, however we also have an APM called 
> appdynamics loaded. Both verified the 8 max connections.
>
> Other tomcat servers with exact same jdbc connection pool config(only 
> difference is servername, databasename, user and pass) show 50 max 
> connections, which is what maxActive is set to.

Are the other tomcat servers running the same tomcat version? Since TC8, the 
default connection pool is DBCP2 which uses maxTotal in place of maxActive. See 
[1]. If you are running 8+, s/maxActive/maxTotal in the config should work.

Phil

[1] 
https://urldefense.com/v3/__https://tomcat.apache.org/migration-8.html*Database_Connection_Pooling__;Iw!!Li8W9_Um1Taa!orxL7Ci-tTj7jM-90ooXXY8VTcDfIzFLc9YZw4Oh-ybxGw-BbIQv4_O0_vGUlXfF$

>
>
>
> Shawn​ Beard
>
> Sr. Systems Engineer |
> BTS
>
> Middleware Engineering | +1-515-564-2528 | 
> sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
>
>
>
>
>
>
>
>
>
> -Original Message-
> From: Johnson, Jim 
> Sent: Tuesday, December 15, 2020 2:22 PM
> To: Tomcat Users List 
> Subject: RE: jdbc connction pool issues [EXTERNAL]
>
> ** CAUTION: External message
>
>
> Hi Shawn,
>
> No, I don't think that maxActive means that it's defining the maximum
> number of connections for the pool, I think it's strictly referring to
> the "[ .. ] maximum number of *active connections* that can be
> allocated from this pool at the same time. [ .. ]" (emphasis mine on
> active connections)
>
> Here is the doc that I've been referring to - sorry for not linking it 
> earlier:
> https://urldefense.com/v3/__https://tomcat.apache.org/tomcat-9.0-doc/j
> dbc-pool.html__;!!Li8W9_Um1Taa!vJGrxr7yc86joO5r6QoNstpipfempGFqrYRe3_N
> yAIGNs-LenmBWhtjn1fRiAOex$
>
> On those other Tomcat servers is there a initialSize defined?
>
> Jim
>
> -Original Message-
> From: Beard, Shawn 
> Sent: Tuesday, December 15, 2020 2:49 PM
> To: Tomcat Users List 
> Subject: RE: jdbc connction pool issues [EXTERNAL]
>
> But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? 
> On other tomcat servers I have, maxActive is set to 50 and I verified im jmx 
> that there are 50 max connections on the connection pool.
>
> Here though I checked jmx, sure enough, its max connections is 8.
>
>
>
> Shawn​ Beard
>
> Sr. Systems Engineer |
> BTS
>
> Middleware Engineering | +1-515-564-2528 |
> sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
>
>
>
>
>
>
>
>
>
> -Original Message-
> From: Johnson, Jim 
> Sent: Tuesday, December 15, 2020 1:35 PM
> To: Tomcat Users List 
> Subject: RE: jdbc connction pool issues [EXTERNAL]
>
> ** CAUTION: External message
>
>
> Hi Shawn,
>
> I think you’re missing initialSize
>
> initialSize
> (int)The initial number of connections that are created when the pool
> is started. Default value is 10
>
> maxActive
> (int) The maximum number of active connections that can be allocated
> from this pool at the same time. The default value is 100
>
> It would make sense that 8 connections would be 80% utilized.
>
> I would try replacing maxActive with initialSize and seeing how that works 
> for you.
>
> Good luck!
>
> - Jim
>
> From: Beard, Shawn 
> Sent: Tuesday, December 15, 2020 2:12 PM
> To: Tomcat Users List 
> Subject: jdbc connction pool issues
>
> CAUTION EXTERNAL EMAIL: This email originated from outside of the 
> organization. Do not click links or open attachments unless you recognize the 
> sender and know the content is safe.
>
> We have this jdbc connection pool set up:
>
>  driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
> url="jdbc:sqlserver://hostname:1433;selectMethod=direct;databaseName=databasename;sendStringParametersAsUnicode=false"
> username="XXX" password="XX" maxIdle="20" minIdle="10" maxActive="50"
> maxWait="3" testWhileIdle="true" testOnBorrow="true"
> validationQuery="SELECT 1&q

Re: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Phil Steitz



On 12/15/20 1:35 PM, Beard, Shawn wrote:

No intitialSize is not defined.

Im getting the data to verify from JMX, however we also have an APM called 
appdynamics loaded. Both verified the 8 max connections.

Other tomcat servers with exact same jdbc connection pool config(only 
difference is servername, databasename, user and pass) show 50 max connections, 
which is what maxActive is set to.


Are the other tomcat servers running the same tomcat version? Since TC8, 
the default connection pool is DBCP2 which uses maxTotal in place of 
maxActive.  See [1]. If you are running 8+, s/maxActive/maxTotal in the 
config should work.


Phil

[1] https://tomcat.apache.org/migration-8.html#Database_Connection_Pooling





Shawn​  Beard

Sr. Systems Engineer |
 BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 2:22 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

No, I don't think that maxActive means that it's defining the maximum number of 
connections for the pool, I think it's strictly referring to the "[ .. ] maximum 
number of *active connections* that can be allocated from this pool at the same time. [ 
.. ]" (emphasis mine on active connections)

Here is the doc that I've been referring to - sorry for not linking it earlier:
https://urldefense.com/v3/__https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html__;!!Li8W9_Um1Taa!vJGrxr7yc86joO5r6QoNstpipfempGFqrYRe3_NyAIGNs-LenmBWhtjn1fRiAOex$

On those other Tomcat servers is there a initialSize defined?

Jim

-Original Message-
From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:49 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? On 
other tomcat servers I have, maxActive is set to 50 and I verified im jmx that 
there are 50 max connections on the connection pool.

Here though I checked jmx, sure enough, its max connections is 8.



Shawn​ Beard

Sr. Systems Engineer |
BTS

Middleware Engineering | +1-515-564-2528 | 
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://urldefense.com/v3/__https://nam05.safelinks.protection.outlook.com/?url=https*3A*2F*2Furldefense.com*2Fv3*2F__https*3A*2F*2Fnam05.safelinks.protection.outlook.com*2F*3Furl*3Dhttps*3A*2F*2Fwww.berkleytechnologyservices.com*2F*26data*3D04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*26sdata*3D3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D*26reserved*3D0__*3BJSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp*24data=04*7C01*7CJ1Johnson*40unum.com*7C016565a918474642884608d8a1328579*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436585655273329*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C2000sdata=tBYkHrqnGHyaJPmtqrHIB5LPJLsZfdU4YdsK2JFVwAo*3Dreserved=0__;JSUlJSUlJSUlJSUqKioqJSUqKioqK

RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Beard, Shawn
Is there a specific factory I should be loading? Or is not specifying and 
allowing default good enough? It is a jdbc connection pool, catalina home is 
set correctly.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Jalaj Asher 
Sent: Tuesday, December 15, 2020 2:39 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,
Check the Catalina home and see if your tomcat set up Is pointed to the correct 
path.
You can check that from the registry as well to make sure the service is not 
pointed to another tomcat which might have these parameters setup.

The registry path is HKEY_LOCAL_MACHINE --> software-->wow6432node ---> apache 
software foundation.

Else you might want to check if the same is a problem with DBCP pool as well . 
As from the details shared looks like you are using jdbc pool.

Regards

Jalaj

-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 3:22 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

Attention: This email was sent from someone outside of eClinicalWorks. Always 
use caution when opening attachments or clicking links from unknown senders or 
when receiving unexpected emails.

Hi Shawn,

No, I don't think that maxActive means that it's defining the maximum number of 
connections for the pool, I think it's strictly referring to the "[ .. ] 
maximum number of *active connections* that can be allocated from this pool at 
the same time. [ .. ]" (emphasis mine on active connections)

Here is the doc that I've been referring to - sorry for not linking it earlier:
https://urldefense.com/v3/__https://nam05.safelinks.protection.outlook.com/?url=https*3A*2F*2Ftomcat.apache.org*2Ftomcat-9.0-doc*2Fjdbc-pool.htmldata=04*7C01*7Cjalaj.asher*40eclinicalworks.com*7C3f5dd36a4b0d458695d908d8a1371f11*7C7ce747e48f6d4e0697efa9b76a063808*7C1*7C0*7C637436605411941490*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000sdata=bPYOMGVa0dYi0ASx*2BuQ5pTdlzpuOKird7pAVi*2FjHQVs*3Dreserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!q2MG45FC18cm0UD-N10yCZgPVqpaQaZGKILOaYz6c1kiDPaCBBP5Q1UZoCWfvJtl$

On those other Tomcat servers is there a initialSize defined?

Jim

-Original Message-
From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:49 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? On 
other tomcat servers I have, maxActive is set to 50 and I verified im jmx that 
there are 50 max connections on the connection pool.

Here though I checked jmx, sure enough, its max connections is 8.



Shawn​ Beard

Sr. Systems Engineer |
BTS

Middleware Engineering | +1-515-564-2528 | 
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://urldefense.com/v3/__https://nam05.safelinks.protection.outlook.com/?url=https*3A*2F*2Furldefense.com*2Fv3*2F__https*3A*2F*2Fnam05.safelinks.protection.outlook.com*2F*3Furl*3Dhttps*3A*2F*2Fwww.berkleytechnologyservices.com*2F*26data*3D04*7C01*7CJ1Joh

RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Jalaj Asher
Hi Shawn,
Check the Catalina home and see if your tomcat set up Is pointed to the correct 
path.
You can check that from the registry as well to make sure the service is not 
pointed to another tomcat which might have these parameters setup.

The registry path is HKEY_LOCAL_MACHINE --> software-->wow6432node ---> apache 
software foundation.

Else you might want to check if the same is a problem with DBCP pool as well . 
As from the details shared looks like you are using jdbc pool.

Regards

Jalaj

-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 3:22 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

Attention: This email was sent from someone outside of eClinicalWorks. Always 
use caution when opening attachments or clicking links from unknown senders or 
when receiving unexpected emails.

Hi Shawn,

No, I don't think that maxActive means that it's defining the maximum number of 
connections for the pool, I think it's strictly referring to the "[ .. ] 
maximum number of *active connections* that can be allocated from this pool at 
the same time. [ .. ]"  (emphasis mine on active connections)

Here is the doc that I've been referring to - sorry for not linking it earlier:
https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftomcat.apache.org%2Ftomcat-9.0-doc%2Fjdbc-pool.htmldata=04%7C01%7Cjalaj.asher%40eclinicalworks.com%7C3f5dd36a4b0d458695d908d8a1371f11%7C7ce747e48f6d4e0697efa9b76a063808%7C1%7C0%7C637436605411941490%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=bPYOMGVa0dYi0ASx%2BuQ5pTdlzpuOKird7pAVi%2FjHQVs%3Dreserved=0

On those other Tomcat servers is there a initialSize defined?

 Jim

-Original Message-
From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:49 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? On 
other tomcat servers I have, maxActive is set to 50 and I verified im jmx that 
there are 50 max connections on the connection pool.

Here though I checked jmx, sure enough, its max connections is 8.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fnam05.safelinks.protection.outlook.com%2F%3Furl%3Dhttps*3A*2F*2Fwww.berkleytechnologyservices.com*2F%26data%3D04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000%26sdata%3D3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D%26reserved%3D0__%3BJSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp%24data=04%7C01%7Cjalaj.asher%40eclinicalworks.com%7C3f5dd36a4b0d458695d908d8a1371f11%7C7ce747e48f6d4e0697efa9b76a063808%7C1%7C0%7C637436605411941490%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=j4JvD%2BB6TzoymQAJookdvrCXXLBvGncjNBlYQ%2B

RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Beard, Shawn
No intitialSize is not defined.

Im getting the data to verify from JMX, however we also have an APM called 
appdynamics loaded. Both verified the 8 max connections.

Other tomcat servers with exact same jdbc connection pool config(only 
difference is servername, databasename, user and pass) show 50 max connections, 
which is what maxActive is set to.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 2:22 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

No, I don't think that maxActive means that it's defining the maximum number of 
connections for the pool, I think it's strictly referring to the "[ .. ] 
maximum number of *active connections* that can be allocated from this pool at 
the same time. [ .. ]" (emphasis mine on active connections)

Here is the doc that I've been referring to - sorry for not linking it earlier:
https://urldefense.com/v3/__https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html__;!!Li8W9_Um1Taa!vJGrxr7yc86joO5r6QoNstpipfempGFqrYRe3_NyAIGNs-LenmBWhtjn1fRiAOex$

On those other Tomcat servers is there a initialSize defined?

Jim

-Original Message-
From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:49 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? On 
other tomcat servers I have, maxActive is set to 50 and I verified im jmx that 
there are 50 max connections on the connection pool.

Here though I checked jmx, sure enough, its max connections is 8.



Shawn​ Beard

Sr. Systems Engineer |
BTS

Middleware Engineering | +1-515-564-2528 | 
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://urldefense.com/v3/__https://nam05.safelinks.protection.outlook.com/?url=https*3A*2F*2Furldefense.com*2Fv3*2F__https*3A*2F*2Fnam05.safelinks.protection.outlook.com*2F*3Furl*3Dhttps*3A*2F*2Fwww.berkleytechnologyservices.com*2F*26data*3D04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*26sdata*3D3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D*26reserved*3D0__*3BJSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp*24data=04*7C01*7CJ1Johnson*40unum.com*7C016565a918474642884608d8a1328579*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436585655273329*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C2000sdata=tBYkHrqnGHyaJPmtqrHIB5LPJLsZfdU4YdsK2JFVwAo*3Dreserved=0__;JSUlJSUlJSUlJSUqKioqJSUqKioqKioqKioqKiolJSoqKiolJSUlJSUlJSUlJSUlJSUlJQ!!Li8W9_Um1Taa!vJGrxr7yc86joO5r6QoNstpipfempGFqrYRe3_NyAIGNs-LenmBWhtjn1ZVqcYXS$
 >

Technology Leadership Unleashing Business Potential


Shawn​

Beard
Sr. Systems Engineer
|
BTS
Middleware Engineering
|
+1-515-564-2528
|
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

CONFIDENTIALITY NOTICE: This e-mail and the 

RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Johnson, Jim
Hi Shawn,

No, I don't think that maxActive means that it's defining the maximum number of 
connections for the pool, I think it's strictly referring to the "[ .. ] 
maximum number of *active connections* that can be allocated from this pool at 
the same time. [ .. ]"  (emphasis mine on active connections)

Here is the doc that I've been referring to - sorry for not linking it earlier:
https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html

On those other Tomcat servers is there a initialSize defined?

 Jim

-Original Message-
From: Beard, Shawn  
Sent: Tuesday, December 15, 2020 2:49 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? On 
other tomcat servers I have, maxActive is set to 50 and I verified im jmx that 
there are 50 max connections on the connection pool.

Here though I checked jmx, sure enough, its max connections is 8.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fnam05.safelinks.protection.outlook.com%2F%3Furl%3Dhttps*3A*2F*2Fwww.berkleytechnologyservices.com*2F%26data%3D04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000%26sdata%3D3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D%26reserved%3D0__%3BJSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp%24data=04%7C01%7CJ1Johnson%40unum.com%7C016565a918474642884608d8a1328579%7Cd5952c785d4e41caaff07174c1f75393%7C0%7C0%7C637436585655273329%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000sdata=tBYkHrqnGHyaJPmtqrHIB5LPJLsZfdU4YdsK2JFVwAo%3Dreserved=0
 >

Technology Leadership Unleashing Business Potential


Shawn​

Beard
Sr. Systems Engineer
|
BTS
Middleware Engineering
|
+1-515-564-2528
|
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.
CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.


RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Johnson, Jim
Hi Shawn,

I can't speak to that monitoring tool or why it reports that way. I do see what 
you're saying though - I would expect the error message to be something like:

>>name="jdbc/DataSource",type=DataSource has reached 80% limit. 
>>Current pool size [8, Max pool size [10]

However, it could be that the number of maxActive connections at the time was 8 
and they simply labeled it incorrectly.

From my perspective it seemed that if you're getting an alert at 80% pool size 
and the current pool size is 8 then you're probably looking for a default 
setting of 10 somewhere that isn't being set and initialSize seemed like a good 
candidate for that setting.

Perhaps you might check your monitoring tool thresholds - I would have to think 
that 80% is setting off bells and whistles so you have time to act before your 
JVM blows up.

Cheers!

- Jim

-Original Message-
From: Beard, Shawn  
Sent: Tuesday, December 15, 2020 2:42 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

If default is 10, they why would we be getting an error about 8 being max?



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fnam05.safelinks.protection.outlook.com%2F%3Furl%3Dhttps*3A*2F*2Fwww.berkleytechnologyservices.com*2F%26data%3D04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000%26sdata%3D3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D%26reserved%3D0__%3BJSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp%24data=04%7C01%7CJ1Johnson%40unum.com%7C45da4026f80749aa4a4308d8a131bb92%7Cd5952c785d4e41caaff07174c1f75393%7C0%7C0%7C637436582286624695%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000sdata=SsGXcy8tkFZxQlLMGWv1%2BZGKqnkiDRx3UvGWqo72a7o%3Dreserved=0
 >

Technology Leadership Unleashing Business Potential


Shawn​

Beard
Sr. Systems Engineer
|
BTS
Middleware Engineering
|
+1-515-564-2528
|
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.
CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the doc

RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Beard, Shawn
But wouldn’t maxActive mean the connection pool has a max of 50 conenctions? On 
other tomcat servers I have, maxActive is set to 50 and I verified im jmx that 
there are 50 max connections on the connection pool.

Here though I checked jmx, sure enough, its max connections is 8.



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://urldefense.com/v3/__https://nam05.safelinks.protection.outlook.com/?url=https*3A*2F*2Fwww.berkleytechnologyservices.com*2F=04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000=3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp$
 >

Technology Leadership Unleashing Business Potential


Shawn​

Beard
Sr. Systems Engineer
|
BTS
Middleware Engineering
|
+1-515-564-2528
|
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.
CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.


RE: jdbc connction pool issues [EXTERNAL]

2020-12-15 Thread Beard, Shawn
If default is 10, they why would we be getting an error about 8 being max?



Shawn​  Beard

Sr. Systems Engineer |
BTS

Middleware Engineering   |  +1-515-564-2528 |  
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>









-Original Message-
From: Johnson, Jim 
Sent: Tuesday, December 15, 2020 1:35 PM
To: Tomcat Users List 
Subject: RE: jdbc connction pool issues [EXTERNAL]

** CAUTION: External message


Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

3840 109th Street Urbandale, IA 50322
Phone: +1-515-564-2528
Email: sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>
Website: 
berkleytechnologyservices.com<https://urldefense.com/v3/__https://nam05.safelinks.protection.outlook.com/?url=https*3A*2F*2Fwww.berkleytechnologyservices.com*2F=04*7C01*7CJ1Johnson*40unum.com*7C64e6e4965acb42aebfe708d8a12d798c*7Cd5952c785d4e41caaff07174c1f75393*7C0*7C0*7C637436563975240326*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000=3nTT6swXEeC2zC*2BUb7Q7nvgxM214SGf7HJaI*2F4*2BYupA*3D=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSU!!Li8W9_Um1Taa!qrMl5L--I8QMohhvL9LXmHKdJz0jf2lM2XTvoH8FwyisGVhxNJdYs74vjiQ2KJgp$
 >

Technology Leadership Unleashing Business Potential


Shawn​

Beard
Sr. Systems Engineer
|
BTS
Middleware Engineering
|
+1-515-564-2528
|
sbe...@wrberkley.com<mailto:sbe...@wrberkley.com>

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.
CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.


RE: jdbc connction pool issues

2020-12-15 Thread Johnson, Jim
Hi Shawn,

I think you’re missing initialSize

initialSize
(int)The initial number of connections that are created when the pool is 
started. Default value is 10

maxActive
(int) The maximum number of active connections that can be allocated from this 
pool at the same time. The default value is 100

It would make sense that 8 connections would be 80% utilized.

I would try replacing maxActive with initialSize and seeing how that works for 
you.

Good luck!

- Jim

From: Beard, Shawn 
Sent: Tuesday, December 15, 2020 2:12 PM
To: Tomcat Users List 
Subject: jdbc connction pool issues

CAUTION EXTERNAL EMAIL: This email originated from outside of the organization. 
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

We have this jdbc connection pool set up:



However we are getting this error:
Resource Pool Limit Reached
Time 12/15/20 11:48:00 AM
Summary
JDBC Connection Pool 
Catalina:class=javax.sql.DataSource,context=/XX,host=X,name="jdbc/DataSource",type=DataSource
 has reached 80% limit. Current pool size [8, Max pool size [8]

Shouldn’t the max connections of the connection pool be 50 since maxActive is 
50?



Shawn Beard • Sr. Systems Engineer
Middleware Engineering

[cid:image003.png@01D6D2E3.D5F1EFA0]

 3840 109th Street Urbandale, IA 50322
 Phone: +1-515-564-2528
 Email: sbe...@wrberkley.com
 Website: 
berkleytechnologyservices.com

Technology Leadership Unleashing Business Potential


Shawn​

Beard
Sr. Systems Engineer
 |
BTS
Middleware Engineering
 |
+1-515-564-2528
 |
sbe...@wrberkley.com

CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain 
private, privileged and confidential information belonging to the sender. The 
information therein is solely for the use of the addressee. If your receipt of 
this transmission has occurred as the result of an error, please immediately 
notify us so we can arrange for the return of the documents. In such 
circumstances, you are advised that you may not disclose, copy, distribute or 
take any other action in reliance on the information transmitted.


Re: JDBC connection pooling maxActive or MaxTotal

2020-01-08 Thread Zahid Rahman
Hey Dave B. ,

My question  from chris was for your benefit.
default configuration is not the same thing as vendor neutral.

chris wrote: > If you use both, you should be all set for whichever pool
you use at
runtime. DOH !

>If you look in your log file, you will notice that when Tomcat starts
>up it will give you a warning that one of the two configuration
> options failed to apply to whichever pool you are using. It is a
> warning, not an error, so you can ignore it. But it will show up in
> your log file every time.
YES IGNORE WARNINGS  BECAUSE we have not made a word connect
between generic and default and and vendor neutral and vendor specific so,
the developer  who wrote warning should be ignored , because he doesn't
know what he is doing.
but you AND chris do know  by shoving two APIs down the throat our beloved
poor little  tomcat.

>Note that you will have to specifically enable tomcat-pool,
so it's unlikely that the pooling-library in use will be a surprise. HUH!

If your are trying to use both APIs then  you should get chris to help you.
Sometimes terms such as generic and vendor neutral can be confusing.
Especially when chris is saying you will get a warning not an error WHEN
YOU USE BOTH.
I know you think he is being helpful,

but actually he has got his nickers in twist because he doesn't know what
those terms mean that he is himself using either.
If he did he would say to you why are you using vendor specific API and
Vendor neutral API at same time on the same application server.
You see what tomcat is really saying  you are confused by terminology just
like chris.


www.backbutton.co.uk
♡۶¯\_(ツ)_/¯ ♡۶
Marriage of loose and tight coupling
-> healthy applications
  ♡۶
Wot no  -classpath  --class-path  even ! -cp
javac   Garden/Vegetables/VineVegetable.java
java   Garden.Vegetables.VineVegetable


On Fri, 3 Jan 2020 at 23:50, zahid  wrote:

> chris,
>
>
> Is commons-dbcp-2.x   a Database pooling component for any container
> Jetty,Jboss tomcat   etc. ?
>
> is commons-dbcp-2.x a third option, separate option from the two pooling
> options [tomcat-pool and commons-pool] you mentioned ?
>
>
> On 03/01/2020 23:21, Dave Bothwell wrote:
> > Chris,
> >
> > That was very helpful.
> >
> > Thank you
> > Dave
> >
> >
> >
> > On Fri, Jan 3, 2020 at 5:29 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA256
> >>
> >> Dave,
> >>
> >> On 1/3/20 13:47, Dave Bothwell wrote:
> >>> I am using Tomcat 8.5.11 with JDBC connection pooling. Based on
> >>> the documentation it is clear that DBCP pooling has changed the
> >>> maxActive attribute to maxTotal. However it is unclear, based on
> >>> this document
> >>> https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC
> >>> pooling has also changed maxActive to maxTotal.
> >>>
> >>> my question is which attribute should I be using?
> >> Are you asking about the difference between configurations for
> >> tomcat-pool and commons-pool?
> >>
> >> commons-pool (which is the default connection-pool in Tomcat) uses
> >> maxTotal.
> >>
> >> tomcat-pool (which is NOT the default connection-pool in Tomcat) uses
> >> maxActive.
> >>
> >>> Also, I am currently using both attributes maxActive and maxTotal
> >>> in my current server.xml file, which does not appear to be causing
> >>> any issues.
> >> If you use both, you should be all set for whichever pool you use at
> >> runtime. Note that you will have to specifically enable tomcat-pool,
> >> so it's unlikely that the pooling-library in use will be a surprise.
> >>
> >> If you look in your log file, you will notice that when Tomcat starts
> >> up it will give you a warning that one of the two configuration
> >> options failed to apply to whichever pool you are using. It is a
> >> warning, not an error, so you can ignore it. But it will show up in
> >> your log file every time.
> >>
> >> - -chris
> >> -BEGIN PGP SIGNATURE-
> >> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> >>
> >> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
> >> pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
> >> EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
> >> /5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
> >> R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
> >> Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
> >> XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
> >> iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
> >> lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
> >> /ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
> >> Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
> >> +jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
> >> =jSNi
> >> -END PGP SIGNATURE-
> >>
> >> 

Re: JDBC connection pooling maxActive or MaxTotal

2020-01-05 Thread Guang Chao
On Sat, Jan 4, 2020 at 2:47 AM Dave Bothwell 
wrote:

> Hello,
>
> I am using Tomcat 8.5.11 with JDBC connection pooling. Based on the
> documentation it is clear that DBCP pooling has changed the maxActive
> attribute to maxTotal. However it is unclear, based on this document
> https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC
> pooling has also changed maxActive to maxTotal.
>
>
You can also have your own connection pooling from your application.  But
of course JNDI has advantage that it is decoupled and container supplies
the connection.


> Also, I am currently using both attributes maxActive and maxTotal in my
> current server.xml file, which does not appear to be causing any issues.
>
> my question is which attribute should I be using?
>
> Thanks
> Dave
>
> --
>
> 
>
> David Bothwell
>
> Chairman of the Board, Chief technology Officer | Primepoint, LLC
>
> Address: 2 Springside Road, Westampton, NJ 08060
>
> Phone: 800-600-5257
>
> -
> -
> -
> <
> https://www.linkedin.com/company/505608?trk=tyah=clickedVertical%3Acompany%2CclickedEntityId%3A505608%2Cidx%3A2-2-3%2CtarId%3A1447790586761%2Ctas%3Aprimepoint
> >
> - - 
>
> --
> This communication, and any information or attachments contained within,
> may contain privileged or confidential information that is intended for
> the
> sole use of the recipient or recipients named above. If the reader of this
> message is not an intended recipient, or authorized to receive such
> messages for an intended recipient, you are hereby notified that any
> review, use, dissemination, copying, or distribution of this
> communication,
> or any of its contents is strictly prohibited. If you have received this
> message in error, please notify us immediately of the error by return
> email
> and permanently remove the original message, its contents, and any copies
> from your system. Thank you.
>


-- 
I love Java 


Re: JDBC connection pooling maxActive or MaxTotal

2020-01-03 Thread zahid

chris,


Is commons-dbcp-2.x   a Database pooling component for any container 
Jetty,Jboss tomcat   etc. ?


is commons-dbcp-2.x a third option, separate option from the two pooling 
options [tomcat-pool and commons-pool] you mentioned ?



On 03/01/2020 23:21, Dave Bothwell wrote:

Chris,

That was very helpful.

Thank you
Dave



On Fri, Jan 3, 2020 at 5:29 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dave,

On 1/3/20 13:47, Dave Bothwell wrote:

I am using Tomcat 8.5.11 with JDBC connection pooling. Based on
the documentation it is clear that DBCP pooling has changed the
maxActive attribute to maxTotal. However it is unclear, based on
this document
https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC
pooling has also changed maxActive to maxTotal.

my question is which attribute should I be using?

Are you asking about the difference between configurations for
tomcat-pool and commons-pool?

commons-pool (which is the default connection-pool in Tomcat) uses
maxTotal.

tomcat-pool (which is NOT the default connection-pool in Tomcat) uses
maxActive.


Also, I am currently using both attributes maxActive and maxTotal
in my current server.xml file, which does not appear to be causing
any issues.

If you use both, you should be all set for whichever pool you use at
runtime. Note that you will have to specifically enable tomcat-pool,
so it's unlikely that the pooling-library in use will be a surprise.

If you look in your log file, you will notice that when Tomcat starts
up it will give you a warning that one of the two configuration
options failed to apply to whichever pool you are using. It is a
warning, not an error, so you can ignore it. But it will show up in
your log file every time.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
/5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
/ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
+jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
=jSNi
-END PGP SIGNATURE-

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



--
www.backbutton.co.uk
  ¯\_(ツ)_/¯
♡۶ Lynx text browser
recover crashed ms-word .doc with ms-debug.


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



Re: JDBC connection pooling maxActive or MaxTotal

2020-01-03 Thread Dave Bothwell
Chris,

That was very helpful.

Thank you
Dave



On Fri, Jan 3, 2020 at 5:29 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Dave,
>
> On 1/3/20 13:47, Dave Bothwell wrote:
> > I am using Tomcat 8.5.11 with JDBC connection pooling. Based on
> > the documentation it is clear that DBCP pooling has changed the
> > maxActive attribute to maxTotal. However it is unclear, based on
> > this document
> > https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC
> > pooling has also changed maxActive to maxTotal.
> >
> > my question is which attribute should I be using?
>
> Are you asking about the difference between configurations for
> tomcat-pool and commons-pool?
>
> commons-pool (which is the default connection-pool in Tomcat) uses
> maxTotal.
>
> tomcat-pool (which is NOT the default connection-pool in Tomcat) uses
> maxActive.
>
> > Also, I am currently using both attributes maxActive and maxTotal
> > in my current server.xml file, which does not appear to be causing
> > any issues.
> If you use both, you should be all set for whichever pool you use at
> runtime. Note that you will have to specifically enable tomcat-pool,
> so it's unlikely that the pooling-library in use will be a surprise.
>
> If you look in your log file, you will notice that when Tomcat starts
> up it will give you a warning that one of the two configuration
> options failed to apply to whichever pool you are using. It is a
> warning, not an error, so you can ignore it. But it will show up in
> your log file every time.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
> pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
> EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
> /5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
> R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
> Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
> XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
> iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
> lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
> /ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
> Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
> +jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
> =jSNi
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 



David Bothwell

Chairman of the Board, Chief technology Officer | Primepoint, LLC

Address: 2 Springside Road, Westampton, NJ 08060

Phone: 800-600-5257

-
-
-

- - 

-- 
This communication, and any information or attachments contained within, 
may contain privileged or confidential information that is intended for the 
sole use of the recipient or recipients named above. If the reader of this 
message is not an intended recipient, or authorized to receive such 
messages for an intended recipient, you are hereby notified that any 
review, use, dissemination, copying, or distribution of this communication, 
or any of its contents is strictly prohibited. If you have received this 
message in error, please notify us immediately of the error by return email 
and permanently remove the original message, its contents, and any copies 
from your system. Thank you.


Re: JDBC connection pooling maxActive or MaxTotal

2020-01-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dave,

On 1/3/20 13:47, Dave Bothwell wrote:
> I am using Tomcat 8.5.11 with JDBC connection pooling. Based on
> the documentation it is clear that DBCP pooling has changed the
> maxActive attribute to maxTotal. However it is unclear, based on
> this document 
> https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC 
> pooling has also changed maxActive to maxTotal.
> 
> my question is which attribute should I be using?

Are you asking about the difference between configurations for
tomcat-pool and commons-pool?

commons-pool (which is the default connection-pool in Tomcat) uses
maxTotal.

tomcat-pool (which is NOT the default connection-pool in Tomcat) uses
maxActive.

> Also, I am currently using both attributes maxActive and maxTotal
> in my current server.xml file, which does not appear to be causing
> any issues.
If you use both, you should be all set for whichever pool you use at
runtime. Note that you will have to specifically enable tomcat-pool,
so it's unlikely that the pooling-library in use will be a surprise.

If you look in your log file, you will notice that when Tomcat starts
up it will give you a warning that one of the two configuration
options failed to apply to whichever pool you are using. It is a
warning, not an error, so you can ignore it. But it will show up in
your log file every time.

- -chris
-BEGIN PGP SIGNATURE-
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl4PwFkACgkQHPApP6U8
pFiEZRAAloB5RkBB0HrUvYfHd2DJbR5h2xt2WxaKbK6Rql/cdjVEC1dftrGSL9a7
EvFkFl8juTA0oD/9mjGHKtN1MLgV+EFEu5hTppR+3wnkX/8djwp8L27AmtQ/xcT8
/5vasZfn8Web/WqJIJGVF9BiEHoUCr4+M7G+PA8rvsskpIAZKux9NhbliDUYUwzi
R7GsjNelBKixCa8Qy5Q7LqNcHN4RDygXKYsLZVoeoliEBaUOTWHeLoXAo6BQYsVW
Tce5S3xePN6ZG3A5o5lT2bIjWKJp4qDu2CgPHJ0TQyAuey4rpkYmeI7uesmZhr6T
XpwWnk8kYLG7ZCRR99KBF0lx67PQmtxZLoN4kDYQ77x7XUW5c/Qsv2PcOcvXmbzk
iau8YsitqivEAtRh68XG4wrK37vGfkGNzTaSPzpZqgCIiJCotIV6mwQMjo97Ium/
lxSTjLhLEkLNDegHk43wiW02AYfn+2FA0QBTiNX5OoWKu2YD/wrWnmljDwQKO6qL
/ycYDnUCjkcmi0NZJil1kJtB2p8EKwy67W7PPRg2sf2VadFgifJlxO326UW1qK+e
Gv8RjXgEHVOt2ydTa6sTFXT1fjcHaojVx5XgEK19UKNIUcMkyOUh6cZ5N/8d9UMn
+jdZIx4hmxYshdoa4TO2JD6H8I087P8VNCL78RbeWTERUBBvvnc=
=jSNi
-END PGP SIGNATURE-

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



Re: JDBC connection pooling maxActive or MaxTotal

2020-01-03 Thread zahid
|I hope these descriptions of the setting helps you in making a decision 
as to the value.  
|


|maxActive| (int) The maximum number of active connections that can be 
allocated from this pool at the same time. The default value is |100|||


|
|

On 03/01/2020 18:47, Dave Bothwell wrote:

Hello,

I am using Tomcat 8.5.11 with JDBC connection pooling. Based on the
documentation it is clear that DBCP pooling has changed the maxActive
attribute to maxTotal. However it is unclear, based on this document
https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html, if JDBC
pooling has also changed maxActive to maxTotal.

Also, I am currently using both attributes maxActive and maxTotal in my
current server.xml file, which does not appear to be causing any issues.

my question is which attribute should I be using?

Thanks
Dave


--
www.backbutton.co.uk
  ¯\_(ツ)_/¯
♡۶ Lynx text browser
recover crashed ms-word .doc with ms-debug.



Re: [jdbc-pool] Validation query leaves transaction open

2016-08-15 Thread John Huss
I don't have one.  I'm creating the pool in code.  Basically like this:

PoolConfiguration p = new PoolProperties();
p.setUrl(url);
p.setDriverClassName(driverClass);
p.setUsername(username);
p.setPassword(password);
p.setJmxEnabled(true);
p.setTestWhileIdle(true);
p.setTestOnBorrow(true);
p.setTestOnReturn(false);
p.setValidationQuery("SELECT 1");
p.setValidationInterval(3);
p.setValidationQueryTimeout(15000);
p.setLogValidationErrors(true);
p.setTimeBetweenEvictionRunsMillis(6);
p.setMaxActive(maxConnections);
p.setMaxIdle(Math.max(maxConnections / 2, minConnections));
p.setMinIdle(minConnections);
p.setInitialSize(minConnections);
p.setMaxWait(maxWait);
p.setRemoveAbandoned(true);
p.setRemoveAbandonedTimeout(60*30); // 30 minutes (in seconds)
p.setLogAbandoned(true);
p.setMinEvictableIdleTimeMillis(5*60*1000); // 5 minutes
p.setFairQueue(true);
p.setJdbcInterceptors(
"org.apache.tomcat.jdbc.pool.interceptor.ConnectionState"
+";org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
);

org.apache.tomcat.jdbc.pool.DataSource result = new
org.apache.tomcat.jdbc.pool.DataSource(p);


On Mon, Aug 15, 2016 at 4:44 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> John,
>
> On 8/11/16 3:33 PM, John Huss wrote:
> > I have verified that in version 8.0.36 of tomcat jdbc the
> > validation query functionality does not commit the transaction it
> > starts in order to run the validation query, which can cause an
> > open transaction for a very long time (possibly until the database
> > crashes).  This seems to be especially problematic if you have a
> > large pool where the connections are idle for a large period of
> > time.
> >
> > I also tested against version 9.0.0M9, and in that version the
> > problem is fixed.  However, nothing about this appears in the
> > release notes for any version (9.0, 8.5, or 8.0).  If this bug has
> > indeed been fixed it should be documented in the release notes.
> > Also, back-porting the fix to the 8.0 branch would be very
> > helpful.
> >
> > For the time being I am working around the problem by changing my
> > validation query from "SELECT 1" to be "SELECT 1; COMMIT" (using
> > postgresql).  This prevents the issue.
> >
> > This was reported previously (three years ago) here:
> > https://mail-archives.apache.org/mod_mbox/tomcat-users/201301.mbox/%3C
> CAPw873vy%2B9kWMQiFPbnTX6g1FSQ8oTVhDJ3Zagp9UkUZ3d5qjw%40mail.gmail.com%3
> E
>
> Can
> >
> you post your whole (sanitized)  definition?
>
> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXsjewAAoJEBzwKT+lPKRYqacP/j/IUunibNUhUMx+FzyfBVZo
> wK2WcQdM/gdjo6VvhT30A5ndf0HgD8PxHt+7ZaQ8LPQ3cqcLem2KhZvaMD0Kaepw
> k2+HCCayv89KhDXBlvLdKBKJ9mNT1s7cgmNLsF0xdvEioTi8KAbJtG0JOndYwQFb
> MUuYBifOoW4ir47tQmETnu0z6rGvezTRu7eycbiaUZw0jNoQgy0WojJQqm2mmQou
> uLkQghDHivqeauCLf/SbnHnJR1RuXTxef6v25M3a0rbC1XpLE9mrv/CExI92Vm9R
> 94iR7olGErxJbjZywSBM4sbdlhT91IFbSeIAh/Q6FlnC2MbJxEH5naUHVIX9q36R
> p94412emJ2tBWxLB8VY5E9hJVeTNzOe2+bhjBypj9z9aewuCi9oDfVs5pTTmKedu
> LypcLCWsXPg4/VQ4DQ6VL81igAnLnNZbcWNueBTQiqEg2F5c3pjEwfc/G4YqTfQ0
> byTRBraKBR3FLU8n9kkwpNpO4MMVX/keUTD1NEhP/NL8ldh+nGroekFx1JBmzIk4
> 5ID8gvtelcS9Mwp+nxz4uUuXYy0iDe4pMX50QRG2AY+Hxye4rfX9NmCG/BYhwNAQ
> x0X/16fZ4usyKOyj75Lya6IfbMTq2ufv8rVciKaIJJXybQNAhgWvO2F1VZHTgdIG
> HT8rSho2EhsqjyNlR2s4
> =28er
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: [jdbc-pool] Validation query leaves transaction open

2016-08-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

John,

On 8/11/16 3:33 PM, John Huss wrote:
> I have verified that in version 8.0.36 of tomcat jdbc the
> validation query functionality does not commit the transaction it
> starts in order to run the validation query, which can cause an
> open transaction for a very long time (possibly until the database
> crashes).  This seems to be especially problematic if you have a
> large pool where the connections are idle for a large period of
> time.
> 
> I also tested against version 9.0.0M9, and in that version the
> problem is fixed.  However, nothing about this appears in the
> release notes for any version (9.0, 8.5, or 8.0).  If this bug has
> indeed been fixed it should be documented in the release notes.
> Also, back-porting the fix to the 8.0 branch would be very
> helpful.
> 
> For the time being I am working around the problem by changing my 
> validation query from "SELECT 1" to be "SELECT 1; COMMIT" (using 
> postgresql).  This prevents the issue.
> 
> This was reported previously (three years ago) here: 
> https://mail-archives.apache.org/mod_mbox/tomcat-users/201301.mbox/%3C
CAPw873vy%2B9kWMQiFPbnTX6g1FSQ8oTVhDJ3Zagp9UkUZ3d5qjw%40mail.gmail.com%3
E

Can
> 
you post your whole (sanitized)  definition?

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXsjewAAoJEBzwKT+lPKRYqacP/j/IUunibNUhUMx+FzyfBVZo
wK2WcQdM/gdjo6VvhT30A5ndf0HgD8PxHt+7ZaQ8LPQ3cqcLem2KhZvaMD0Kaepw
k2+HCCayv89KhDXBlvLdKBKJ9mNT1s7cgmNLsF0xdvEioTi8KAbJtG0JOndYwQFb
MUuYBifOoW4ir47tQmETnu0z6rGvezTRu7eycbiaUZw0jNoQgy0WojJQqm2mmQou
uLkQghDHivqeauCLf/SbnHnJR1RuXTxef6v25M3a0rbC1XpLE9mrv/CExI92Vm9R
94iR7olGErxJbjZywSBM4sbdlhT91IFbSeIAh/Q6FlnC2MbJxEH5naUHVIX9q36R
p94412emJ2tBWxLB8VY5E9hJVeTNzOe2+bhjBypj9z9aewuCi9oDfVs5pTTmKedu
LypcLCWsXPg4/VQ4DQ6VL81igAnLnNZbcWNueBTQiqEg2F5c3pjEwfc/G4YqTfQ0
byTRBraKBR3FLU8n9kkwpNpO4MMVX/keUTD1NEhP/NL8ldh+nGroekFx1JBmzIk4
5ID8gvtelcS9Mwp+nxz4uUuXYy0iDe4pMX50QRG2AY+Hxye4rfX9NmCG/BYhwNAQ
x0X/16fZ4usyKOyj75Lya6IfbMTq2ufv8rVciKaIJJXybQNAhgWvO2F1VZHTgdIG
HT8rSho2EhsqjyNlR2s4
=28er
-END PGP SIGNATURE-

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



Re: [jdbc-pool] Validation query leaves transaction open

2016-08-12 Thread Jose María Zaragoza
2016-08-12 13:46 GMT+02:00 John Huss :
> In every database I have used every query requires a transaction. Often
> they will start them automatically if you don't do it explicitly.

Right , but I guess that Tomcat uses JDBC connections and I wonder why
for executing validationQuery sentence, Tomcat doesn't use autocommit
= true setting


> On Fri, Aug 12, 2016 at 4:13 AM Jose María Zaragoza 
> wrote:
>
>> 2016-08-11 21:33 GMT+02:00 John Huss :
>> > I have verified that in version 8.0.36 of tomcat jdbc the validation
>> query
>> > functionality does not commit the transaction it starts in order to run
>> the
>> > validation query, which can cause an open transaction for a very long
>> time
>> > (possibly until the database crashes).  This seems to be especially
>> > problematic if you have a large pool where the connections are idle for a
>> > large period of time.
>> >
>> > I also tested against version 9.0.0M9, and in that version the problem is
>> > fixed.  However, nothing about this appears in the release notes for any
>> > version (9.0, 8.5, or 8.0).  If this bug has indeed been fixed it should
>> be
>> > documented in the release notes.  Also, back-porting the fix to the 8.0
>> > branch would be very helpful.
>> >
>> > For the time being I am working around the problem by changing my
>> > validation query from "SELECT 1" to be "SELECT 1; COMMIT" (using
>> > postgresql).  This prevents the issue.
>>
>>
>> I wonder why a validationQuery needs to open a new transaction
>>
>>
>> >
>> > This was reported previously (three years ago) here:
>> >
>> https://mail-archives.apache.org/mod_mbox/tomcat-users/201301.mbox/%3CCAPw873vy%2B9kWMQiFPbnTX6g1FSQ8oTVhDJ3Zagp9UkUZ3d5qjw%40mail.gmail.com%3E
>> >
>> > Thanks,
>> > John
>>
>> -
>> 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: [jdbc-pool] Validation query leaves transaction open

2016-08-12 Thread John Huss
In every database I have used every query requires a transaction. Often
they will start them automatically if you don't do it explicitly.
On Fri, Aug 12, 2016 at 4:13 AM Jose María Zaragoza 
wrote:

> 2016-08-11 21:33 GMT+02:00 John Huss :
> > I have verified that in version 8.0.36 of tomcat jdbc the validation
> query
> > functionality does not commit the transaction it starts in order to run
> the
> > validation query, which can cause an open transaction for a very long
> time
> > (possibly until the database crashes).  This seems to be especially
> > problematic if you have a large pool where the connections are idle for a
> > large period of time.
> >
> > I also tested against version 9.0.0M9, and in that version the problem is
> > fixed.  However, nothing about this appears in the release notes for any
> > version (9.0, 8.5, or 8.0).  If this bug has indeed been fixed it should
> be
> > documented in the release notes.  Also, back-porting the fix to the 8.0
> > branch would be very helpful.
> >
> > For the time being I am working around the problem by changing my
> > validation query from "SELECT 1" to be "SELECT 1; COMMIT" (using
> > postgresql).  This prevents the issue.
>
>
> I wonder why a validationQuery needs to open a new transaction
>
>
> >
> > This was reported previously (three years ago) here:
> >
> https://mail-archives.apache.org/mod_mbox/tomcat-users/201301.mbox/%3CCAPw873vy%2B9kWMQiFPbnTX6g1FSQ8oTVhDJ3Zagp9UkUZ3d5qjw%40mail.gmail.com%3E
> >
> > Thanks,
> > John
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: [jdbc-pool] Validation query leaves transaction open

2016-08-12 Thread Jose María Zaragoza
2016-08-11 21:33 GMT+02:00 John Huss :
> I have verified that in version 8.0.36 of tomcat jdbc the validation query
> functionality does not commit the transaction it starts in order to run the
> validation query, which can cause an open transaction for a very long time
> (possibly until the database crashes).  This seems to be especially
> problematic if you have a large pool where the connections are idle for a
> large period of time.
>
> I also tested against version 9.0.0M9, and in that version the problem is
> fixed.  However, nothing about this appears in the release notes for any
> version (9.0, 8.5, or 8.0).  If this bug has indeed been fixed it should be
> documented in the release notes.  Also, back-porting the fix to the 8.0
> branch would be very helpful.
>
> For the time being I am working around the problem by changing my
> validation query from "SELECT 1" to be "SELECT 1; COMMIT" (using
> postgresql).  This prevents the issue.


I wonder why a validationQuery needs to open a new transaction


>
> This was reported previously (three years ago) here:
> https://mail-archives.apache.org/mod_mbox/tomcat-users/201301.mbox/%3CCAPw873vy%2B9kWMQiFPbnTX6g1FSQ8oTVhDJ3Zagp9UkUZ3d5qjw%40mail.gmail.com%3E
>
> Thanks,
> John

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



Re: jdbc check available database

2016-08-09 Thread Jose María Zaragoza
2016-08-09 10:52 GMT+02:00 Andrea Galli <andrea.ga...@tp-italia.com>:
> Thank you Christoph , but in this how-to there isn't any example for SQL
> Server.

This is my configuration (context.xml) for a SQL Server connection pool



You need a SQL Server JDBC driver


>
> -Messaggio originale-
> Da: Christoph Nenning [mailto:christoph.nenn...@lex-com.net]
> Inviato: martedì 2 agosto 2016 09:44
> A: Tomcat Users List <users@tomcat.apache.org>
> Oggetto: Re: jdbc check available database
>
>> Hello guys,
>>
>> I’ve SQL Server database with Tomcat 7 and, when I restart only
> database,
>>  webapps on Tomcat didn’t works , it show me error to connect to
> database ..
>>
>> In webapp context I use jdbc driver for connect, so there is a kind of
>> method for retry to connect to database when it return available?
>>
>>
>>
>
> Hi,
>
> I suggest to use a DataSource instead of dealing with jdbc connections on
> your own.
>
> see:
> http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html
>
>
> Regards,
> Christoph
>
>
> This Email was scanned by Sophos Anti Virus
>
> -
> 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: jdbc check available database

2016-08-02 Thread Christoph Nenning
> Hello guys,
> 
> I’ve SQL Server database with Tomcat 7 and, when I restart only 
database,
>  webapps on Tomcat didn’t works , it show me error to connect to 
database ..
> 
> In webapp context I use jdbc driver for connect, so there is a kind of
> method for retry to connect to database when it return available?
> 
> 
> 

Hi,

I suggest to use a DataSource instead of dealing with jdbc connections on 
your own.

see:
http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html


Regards,
Christoph


This Email was scanned by Sophos Anti Virus


Re: JDBC Connection pooling

2016-01-26 Thread Felix Schumacher

Am 22.01.2016 um 12:35 schrieb R. Sriram:

Hello I am trying to establish connection pooling.
Should I be using dbcp?
If you want to use db connection pooling, it is probably a good idea to 
use the pooling method the container gives you, as it will be used by a 
lot of people and therefore has gotten a lot of testing.


In the case of tomcat that would be a copy of commons dbcp(2).

Regards,
 Felix



-
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: JDBC PoolExhaustedException

2015-10-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Nathan,

On 10/9/15 4:11 PM, Nathan Boyce wrote:
> Does the tomcat jdbc pool use its own executor or does it share
> the executor that's calling it?

A connection pool rarely has a thread pool associated with it: it's
just a repository for connections. Most pools have an optional
"cleaner" thread, but its usually one thread that does the cleaning
separate from any client code.

> Reason I ask is the pool size is set to 320 but only 84 show busy.
> The default tomcatThreadPool executor has been removed from this
> config and executor with the name AJPThreadPool has been added for
> the ajp connections. The ajp thread pool is maxing out but unable
> to tell is it's the cause or effect.
> 
> Server.xml config  maxThreads="750" minSpareThreads="10" maxIdleTime="1" 
> prestartminSpareThreads="true"/>
> 
> Error org.apache.tomcat.jdbc.pool.PoolExhaustedException:
> [ajp-693] Timeout: Pool empty. Unable to fetch a connection in 10
> seconds, none available[size:320; busy:84; idle:0;
> lastwait:1].

Is there anything else in the log?

Perhaps a new connection cannot be created. Resource limit on the
server, maybe?

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJWHQrdAAoJEBzwKT+lPKRYO1MQAMMsq3OBnCuMlVYU4e4u6SHV
1n/TNmFScTAgMusYzDMca/Q4Vkxq61FSpRPJS95e/YzfiQ5Z9W/jChZl2vK11Zn5
uNst2j7m4FYNe5eupuyCKxpYgTvP4kT+vYMgz9hqqxctqyWVHIHp44W88hnH6pxi
vcmeXnWQeq8QwDYzGyF9MDEzQI6PRcA/aUK0cgg6nwcHulSZ01anTRpmgH/10qe0
nF2AOlUvS2mkFAJy5FXzJJU4gCGyWhkovuJvbliJcBceMDmMuIJ6i8DHVQcSSW8c
I7AwlNYDbPe3ZuxwRSzmVH7MkRRPbPqWBTf2Ws8J0uUBXI9B9VxdOEYAoJyTmeQp
tSQVQxUic5MsK3pUbQEJvlEvLgZcK86nGXPiq0QT8WBLpdQZTqqcitvjw6Z2iSqL
cF+fAwSOcSUujB9lDv0rYVkyg0CdRnSRxkLb0q90qZbfsNAg4HokIasZyQO0Jw6x
1ogN62VGERA1zslBGOCK31w4O6EU3+5IJEHPu6UmOHqbAewYgoUNuWt3g0jtMi6Z
C1CroUNR15sr0kUQUx7sZYnUie1JsSP8Lxzenu1B0aySHDZID4HxyNCUsmh8ub7t
dQhVHLKtajKCWHcVWxPCzIyClAMiBFpxElnT+z6f7CUnlRYIKQMa9mj5MYDol0IM
6Xrzyb5XWYmXgI+18urK
=HUC0
-END PGP SIGNATURE-

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



Re: JDBC Realm exceptions

2015-02-20 Thread Leonid Rozenblyum
Thanks for the idea with the view!

On Thu, Feb 19, 2015 at 9:03 PM, Felix Schumacher
felix.schumac...@internetallee.de wrote:
 Am 19.02.2015 um 13:58 schrieb Leonid Rozenblyum:

 I'm sorry for the late response.

 1. After deeper check I see our structure is NOT much more complex
 than standard Tomcat structure.
 Actually the significant difference is : user roles table has foreign
 key to id in users table (so we join by id not by username)

 Maybe you could add a view to your database, so that it will do the join for
 you and you could use the normal DatasourceRealm instead.

 Regards
 Felix


 2. Great news about fix in 8.0.19! We'll wait for it with impatience.

 On Fri, Feb 6, 2015 at 8:09 AM, Felix Schumacher
 felix.schumac...@internetallee.de wrote:


 Am 5. Februar 2015 22:21:38 MEZ, schrieb Leonid Rozenblyum
 lrozenbl...@gmail.com:

 Hello Felix!
 Thanks for the detail answer! Good suggestion about  DataSourceRealm!
 (I thought about this possibility but then I discovered that we have
 extended JDBCRealm to support some complex DB structure so maybe this
 switch to another Realm is not SO easy as it should be).

 It would be a good idea to share what complex structure you need to
 support. Maybe it would be worth to extend the standard realms to support
 them as well.

 On the other hand the code of JDBCRealm and DataSourceRealm are quit
 similar, so it should be easy for you to port your code.

 Is it a good idea to suggest reducing logging level inside the
 JDBCRealm if this is not an issue to worry about? E.g. not SEVERE but
 DEBUG or TRACE?

 I fixed the error, it should be in tomcat 8.0.19.

 Felix


 On Thu, Feb 5, 2015 at 10:14 PM, Felix Schumacher
 felix.schumac...@internetallee.de wrote:

 Hi Leonid,

 Am 05.02.2015 um 16:28 schrieb Leonid Rozenblyum:

 Hello!

 After upgrading from Tomcat7 to Tomcat8 we started facing

 exceptions:

 rg.apache.catalina.realm.JDBCRealm getPassword
 SEVERE: Exception performing authentication
 org.postgresql.util.PSQLException: This statement has been closed.

 They look like not giving any harm (?).

 JDBCRealm will try again after it reports the error, so no real harm

 for

 you.

 The exception gets thrown, because the PreparedStatement is used with

 a

 try-with block, which closes the instance variable, which is reused

 later

 (then obviously closed :( ).

 Could we do anything to avoid this? Is it some kind of
 misconfiguration at our side or some issue in Tomcat?

 Use DataSourceRealm :)

 Regards
   Felix


 I've googled and found



 http://stackoverflow.com/questions/24534286/strange-jdbcream-exception-occurs-on-tomcat

 but without any suggestions what to do.

 Thanks for any help.


 -
 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: JDBC Realm exceptions

2015-02-19 Thread Leonid Rozenblyum
I'm sorry for the late response.

1. After deeper check I see our structure is NOT much more complex
than standard Tomcat structure.
Actually the significant difference is : user roles table has foreign
key to id in users table (so we join by id not by username)

2. Great news about fix in 8.0.19! We'll wait for it with impatience.

On Fri, Feb 6, 2015 at 8:09 AM, Felix Schumacher
felix.schumac...@internetallee.de wrote:


 Am 5. Februar 2015 22:21:38 MEZ, schrieb Leonid Rozenblyum 
 lrozenbl...@gmail.com:
Hello Felix!
Thanks for the detail answer! Good suggestion about  DataSourceRealm!
(I thought about this possibility but then I discovered that we have
extended JDBCRealm to support some complex DB structure so maybe this
switch to another Realm is not SO easy as it should be).

 It would be a good idea to share what complex structure you need to support. 
 Maybe it would be worth to extend the standard realms to support them as well.

 On the other hand the code of JDBCRealm and DataSourceRealm are quit similar, 
 so it should be easy for you to port your code.


Is it a good idea to suggest reducing logging level inside the
JDBCRealm if this is not an issue to worry about? E.g. not SEVERE but
DEBUG or TRACE?
 I fixed the error, it should be in tomcat 8.0.19.

 Felix


On Thu, Feb 5, 2015 at 10:14 PM, Felix Schumacher
felix.schumac...@internetallee.de wrote:
 Hi Leonid,

 Am 05.02.2015 um 16:28 schrieb Leonid Rozenblyum:

 Hello!

 After upgrading from Tomcat7 to Tomcat8 we started facing
exceptions:

 rg.apache.catalina.realm.JDBCRealm getPassword
 SEVERE: Exception performing authentication
 org.postgresql.util.PSQLException: This statement has been closed.

 They look like not giving any harm (?).

 JDBCRealm will try again after it reports the error, so no real harm
for
 you.

 The exception gets thrown, because the PreparedStatement is used with
a
 try-with block, which closes the instance variable, which is reused
later
 (then obviously closed :( ).

 Could we do anything to avoid this? Is it some kind of
 misconfiguration at our side or some issue in Tomcat?

 Use DataSourceRealm :)

 Regards
  Felix


 I've googled and found


http://stackoverflow.com/questions/24534286/strange-jdbcream-exception-occurs-on-tomcat

 but without any suggestions what to do.

 Thanks for any help.


-
 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


-
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


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



Re: JDBC Realm exceptions

2015-02-19 Thread Felix Schumacher

Am 19.02.2015 um 13:58 schrieb Leonid Rozenblyum:

I'm sorry for the late response.

1. After deeper check I see our structure is NOT much more complex
than standard Tomcat structure.
Actually the significant difference is : user roles table has foreign
key to id in users table (so we join by id not by username)
Maybe you could add a view to your database, so that it will do the join 
for you and you could use the normal DatasourceRealm instead.


Regards
Felix


2. Great news about fix in 8.0.19! We'll wait for it with impatience.

On Fri, Feb 6, 2015 at 8:09 AM, Felix Schumacher
felix.schumac...@internetallee.de wrote:


Am 5. Februar 2015 22:21:38 MEZ, schrieb Leonid Rozenblyum 
lrozenbl...@gmail.com:

Hello Felix!
Thanks for the detail answer! Good suggestion about  DataSourceRealm!
(I thought about this possibility but then I discovered that we have
extended JDBCRealm to support some complex DB structure so maybe this
switch to another Realm is not SO easy as it should be).

It would be a good idea to share what complex structure you need to support. 
Maybe it would be worth to extend the standard realms to support them as well.

On the other hand the code of JDBCRealm and DataSourceRealm are quit similar, 
so it should be easy for you to port your code.


Is it a good idea to suggest reducing logging level inside the
JDBCRealm if this is not an issue to worry about? E.g. not SEVERE but
DEBUG or TRACE?

I fixed the error, it should be in tomcat 8.0.19.

Felix


On Thu, Feb 5, 2015 at 10:14 PM, Felix Schumacher
felix.schumac...@internetallee.de wrote:

Hi Leonid,

Am 05.02.2015 um 16:28 schrieb Leonid Rozenblyum:

Hello!

After upgrading from Tomcat7 to Tomcat8 we started facing

exceptions:

rg.apache.catalina.realm.JDBCRealm getPassword
SEVERE: Exception performing authentication
org.postgresql.util.PSQLException: This statement has been closed.

They look like not giving any harm (?).

JDBCRealm will try again after it reports the error, so no real harm

for

you.

The exception gets thrown, because the PreparedStatement is used with

a

try-with block, which closes the instance variable, which is reused

later

(then obviously closed :( ).

Could we do anything to avoid this? Is it some kind of
misconfiguration at our side or some issue in Tomcat?

Use DataSourceRealm :)

Regards
  Felix


I've googled and found



http://stackoverflow.com/questions/24534286/strange-jdbcream-exception-occurs-on-tomcat

but without any suggestions what to do.

Thanks for any help.



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



Re: JDBC Realm exceptions

2015-02-05 Thread Felix Schumacher


Am 5. Februar 2015 22:21:38 MEZ, schrieb Leonid Rozenblyum 
lrozenbl...@gmail.com:
Hello Felix!
Thanks for the detail answer! Good suggestion about  DataSourceRealm!
(I thought about this possibility but then I discovered that we have
extended JDBCRealm to support some complex DB structure so maybe this
switch to another Realm is not SO easy as it should be).

It would be a good idea to share what complex structure you need to support. 
Maybe it would be worth to extend the standard realms to support them as well.

On the other hand the code of JDBCRealm and DataSourceRealm are quit similar, 
so it should be easy for you to port your code. 


Is it a good idea to suggest reducing logging level inside the
JDBCRealm if this is not an issue to worry about? E.g. not SEVERE but
DEBUG or TRACE?
I fixed the error, it should be in tomcat 8.0.19.

Felix


On Thu, Feb 5, 2015 at 10:14 PM, Felix Schumacher
felix.schumac...@internetallee.de wrote:
 Hi Leonid,

 Am 05.02.2015 um 16:28 schrieb Leonid Rozenblyum:

 Hello!

 After upgrading from Tomcat7 to Tomcat8 we started facing
exceptions:

 rg.apache.catalina.realm.JDBCRealm getPassword
 SEVERE: Exception performing authentication
 org.postgresql.util.PSQLException: This statement has been closed.

 They look like not giving any harm (?).

 JDBCRealm will try again after it reports the error, so no real harm
for
 you.

 The exception gets thrown, because the PreparedStatement is used with
a
 try-with block, which closes the instance variable, which is reused
later
 (then obviously closed :( ).

 Could we do anything to avoid this? Is it some kind of
 misconfiguration at our side or some issue in Tomcat?

 Use DataSourceRealm :)

 Regards
  Felix


 I've googled and found


http://stackoverflow.com/questions/24534286/strange-jdbcream-exception-occurs-on-tomcat

 but without any suggestions what to do.

 Thanks for any help.


-
 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


-
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: JDBC authentication problem

2015-02-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 2/5/15 5:25 AM, Luc DALLEMANE wrote:
 The keep alive on postgres was already setup, but was not working.
 However, I finally found a workaround.
 
 I'm using the tomcat connexion pool, but For the authentication,
 Tomcat is creating its own connexion and does not use the pool (and
 seems to use the same connexion all along the session).
 
 So I think that's was why it was dropped by the firewall after a
 while, and when we restarted tomcat, the connexion was recreated
 and it worked again.
 
 To resolve this problem, we override Tomcat's authenticate method.
 We made our own open function which uses the postgres driver and is
 called in the authenticate. We do not use the getPassword and
 getRoles function, because they used the Tomcat's global
 connexion.
 
 With this, we are now able to connect to the site even after a long
 period of inactivity.
 
 Thank you for your help, and maybe this could help someone else.

None of that should be necessary /at all/. Did you switch-over to
using the DataSourceRealm or not?

JDBCRealm is pretty stupid.

- -chris

  De : Felix Schumacher
 felix.schumac...@internetallee.de Envoyé : mercredi 4 février
 2015 20:11 À : Tomcat Users List Objet : Re: JDBC authentication
 problem
 
 Am 04.02.2015 um 14:21 schrieb Luc DALLEMANE:
 Hi,
 
 I'm back again with the problem :)
 
 Firstly, I add the validationQuery and it works and I can see it
 in postgres logs.
 
 But still not able to login after a while of inactivity
 
 Now, after 15 min of waiting, I'm getting a socket connexion
 timeout, but seems logic after such a long period of trying to
 connect.
 
 Thank you again for your ideas and haven't found a solution.
 You might try to enable keepalive on your postgresql connection. 
 Connection porperties can be specified with the attribute 
 connectionProperties (at least according to 
 http://commons.apache.org/proper/commons-dbcp/configuration.html)
 or in the jdbc url jdbc://...?tcpKeepAlive=true. You can even
 specify the timeout for connnecting to your database.
 
 Regards Felix
 
 Regards, Luc.  De :
 Konstantin Kolinko knst.koli...@gmail.com Envoyé : mardi 3
 février 2015 12:33 À : Tomcat Users List Objet : Re: JDBC
 authentication problem
 
 2015-02-03 14:29 GMT+03:00 Luc DALLEMANE
 ldallem...@alaloop.com:
 Hi,
 
 Thanks for the reply, I tried to add the options you told me
 about (testWhileIdle, timeBetweenEvictionRunsMillis, and
 maxConnLifetimeMillis), but I'm still unable to log after un
 hour ...
 Do you have validationQuery configured?  testOnBorrow,
 testWhileIdle do not work without it.
 
 
 Best regards, Konstantin Kolinko
 
 -

 
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
 
 
 
 -

 
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
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJU03ulAAoJEBzwKT+lPKRYUPoQAKUx68eqWORIYbvUJr9i2G01
cd7xbemgBy0tWP2DmCG6D1MAEqfzphXXTCuOqvf1sg3aU+XbQtAexezJA826XXVb
5KrgQu3wYWG0Bc3D2tCNrzLzz8yqUE33+R+H13CGXPBX5vO48DvfjUZuMQ65/SQ+
G05t1LuljBTVulqwzK3l4lt48CS02xTlEu7KtMQ0WagmoeTnjBPZRjxuMNdtXeW6
DIW4MT++yOgptlOyyHbY1rjtlobP9vSpKK97cuwbG1W9DN+9FQ2HqDe+7V9QnNVg
9vr3eyj6wkOYAdzwatT8yusugxFJhl3reMavGdeYZzyv1leC6oLlBEZ4SEG5mftu
yT7L9pwNWPChJVhpq8VXDWsz63M8WGCDYyvjjRKCkca0eUSRv2dnWTsjsDfRTLT7
JORaDs1KF5x57Wb0yy7sLcsPty9U+FAxhFykYQdGUKjB8O9ZEZ+NFv0XrIqn0M+R
6+8r5ndr1uG+vqETeTnK4Eq+l2aZ0OaYbBhf0mpDvhCcqGlbD19AglUUsWN5Gevw
FLPhi0FSokLnV6uthypeKIixEtB66BrHsnXb+yl/q42GfExeSPEwSzLS48spPxDf
AppY8vCGdhtkEwhJqsbpdgeEwOakMhs1e8TuJ2tXIiDMoCLrcEmH0Lur0twWt0NW
CGqDrWy22blnCxqcneTj
=iDbk
-END PGP SIGNATURE-

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



Re: JDBC Realm exceptions

2015-02-05 Thread Leonid Rozenblyum
Hello Felix!
Thanks for the detail answer! Good suggestion about  DataSourceRealm!
(I thought about this possibility but then I discovered that we have
extended JDBCRealm to support some complex DB structure so maybe this
switch to another Realm is not SO easy as it should be).

Is it a good idea to suggest reducing logging level inside the
JDBCRealm if this is not an issue to worry about? E.g. not SEVERE but
DEBUG or TRACE?


On Thu, Feb 5, 2015 at 10:14 PM, Felix Schumacher
felix.schumac...@internetallee.de wrote:
 Hi Leonid,

 Am 05.02.2015 um 16:28 schrieb Leonid Rozenblyum:

 Hello!

 After upgrading from Tomcat7 to Tomcat8 we started facing exceptions:

 rg.apache.catalina.realm.JDBCRealm getPassword
 SEVERE: Exception performing authentication
 org.postgresql.util.PSQLException: This statement has been closed.

 They look like not giving any harm (?).

 JDBCRealm will try again after it reports the error, so no real harm for
 you.

 The exception gets thrown, because the PreparedStatement is used with a
 try-with block, which closes the instance variable, which is reused later
 (then obviously closed :( ).

 Could we do anything to avoid this? Is it some kind of
 misconfiguration at our side or some issue in Tomcat?

 Use DataSourceRealm :)

 Regards
  Felix


 I've googled and found

 http://stackoverflow.com/questions/24534286/strange-jdbcream-exception-occurs-on-tomcat

 but without any suggestions what to do.

 Thanks for any help.

 -
 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


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



RE: JDBC authentication problem

2015-02-05 Thread Felix Schumacher


Am 5. Februar 2015 11:25:13 MEZ, schrieb Luc DALLEMANE ldallem...@alaloop.com:
Hi,

The keep alive on postgres was already setup, but was not working.
However, I finally found a workaround.

I'm using the tomcat connexion pool, but For the authentication, Tomcat
is creating its own connexion and does not use the pool (and seems to
use the same connexion all along the session).

Which realm do you use? 

Felix

So I think that's was why it was dropped by the firewall after a while,
and when we restarted tomcat, the connexion was recreated and it worked
again.

To resolve this problem, we override Tomcat's authenticate method. We
made our own open function which uses the postgres driver and is called
in the authenticate.
We do not use the getPassword and getRoles function, because they used
the Tomcat's global connexion.

With this, we are now able to connect to the site even after a long
period of inactivity.

Thank you for your help, and maybe this could help someone else.

Regards, Luc.

De : Felix Schumacher felix.schumac...@internetallee.de
Envoyé : mercredi 4 février 2015 20:11
À : Tomcat Users List
Objet : Re: JDBC authentication problem

Am 04.02.2015 um 14:21 schrieb Luc DALLEMANE:
 Hi,

 I'm back again with the problem :)

 Firstly, I add the validationQuery and it works and I can see it in
postgres logs.

 But still not able to login after a while of inactivity

 Now, after 15 min of waiting, I'm getting a socket connexion timeout,
but seems logic after such a long period of trying to connect.

 Thank you again for your ideas and haven't found a solution.
You might try to enable keepalive on your postgresql connection.
Connection porperties can be specified with the attribute
connectionProperties (at least according to
http://commons.apache.org/proper/commons-dbcp/configuration.html) or in
the jdbc url jdbc://...?tcpKeepAlive=true. You can even specify the
timeout for connnecting to your database.

Regards
  Felix

 Regards, Luc.
 
 De : Konstantin Kolinko knst.koli...@gmail.com
 Envoyé : mardi 3 février 2015 12:33
 À : Tomcat Users List
 Objet : Re: JDBC authentication problem

 2015-02-03 14:29 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,

 Thanks for the reply, I tried to add the options you told me about
(testWhileIdle, timeBetweenEvictionRunsMillis, and
maxConnLifetimeMillis), but I'm still unable to log after un hour ...
 Do you have validationQuery configured?  testOnBorrow, testWhileIdle
 do not work without it.


 Best regards,
 Konstantin Kolinko

 -
 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



-
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


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



RE: JDBC authentication problem

2015-02-05 Thread Luc DALLEMANE
Hi,

The keep alive on postgres was already setup, but was not working. However, I 
finally found a workaround.

I'm using the tomcat connexion pool, but For the authentication, Tomcat is 
creating its own connexion and does not use the pool (and seems to use the same 
connexion all along the session).

So I think that's was why it was dropped by the firewall after a while, and 
when we restarted tomcat, the connexion was recreated and it worked again.

To resolve this problem, we override Tomcat's authenticate method. We made our 
own open function which uses the postgres driver and is called in the 
authenticate.
We do not use the getPassword and getRoles function, because they used the 
Tomcat's global connexion.

With this, we are now able to connect to the site even after a long period of 
inactivity.

Thank you for your help, and maybe this could help someone else.

Regards, Luc.

De : Felix Schumacher felix.schumac...@internetallee.de
Envoyé : mercredi 4 février 2015 20:11
À : Tomcat Users List
Objet : Re: JDBC authentication problem

Am 04.02.2015 um 14:21 schrieb Luc DALLEMANE:
 Hi,

 I'm back again with the problem :)

 Firstly, I add the validationQuery and it works and I can see it in postgres 
 logs.

 But still not able to login after a while of inactivity

 Now, after 15 min of waiting, I'm getting a socket connexion timeout, but 
 seems logic after such a long period of trying to connect.

 Thank you again for your ideas and haven't found a solution.
You might try to enable keepalive on your postgresql connection.
Connection porperties can be specified with the attribute
connectionProperties (at least according to
http://commons.apache.org/proper/commons-dbcp/configuration.html) or in
the jdbc url jdbc://...?tcpKeepAlive=true. You can even specify the
timeout for connnecting to your database.

Regards
  Felix

 Regards, Luc.
 
 De : Konstantin Kolinko knst.koli...@gmail.com
 Envoyé : mardi 3 février 2015 12:33
 À : Tomcat Users List
 Objet : Re: JDBC authentication problem

 2015-02-03 14:29 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,

 Thanks for the reply, I tried to add the options you told me about 
 (testWhileIdle, timeBetweenEvictionRunsMillis, and maxConnLifetimeMillis), 
 but I'm still unable to log after un hour ...
 Do you have validationQuery configured?  testOnBorrow, testWhileIdle
 do not work without it.


 Best regards,
 Konstantin Kolinko

 -
 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



-
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: JDBC Realm exceptions

2015-02-05 Thread Felix Schumacher

Hi Leonid,

Am 05.02.2015 um 16:28 schrieb Leonid Rozenblyum:

Hello!

After upgrading from Tomcat7 to Tomcat8 we started facing exceptions:

rg.apache.catalina.realm.JDBCRealm getPassword
SEVERE: Exception performing authentication
org.postgresql.util.PSQLException: This statement has been closed.

They look like not giving any harm (?).
JDBCRealm will try again after it reports the error, so no real harm for 
you.


The exception gets thrown, because the PreparedStatement is used with a 
try-with block, which closes the instance variable, which is reused 
later (then obviously closed :( ).

Could we do anything to avoid this? Is it some kind of
misconfiguration at our side or some issue in Tomcat?

Use DataSourceRealm :)

Regards
 Felix


I've googled and found
http://stackoverflow.com/questions/24534286/strange-jdbcream-exception-occurs-on-tomcat

but without any suggestions what to do.

Thanks for any help.

-
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: JDBC authentication problem

2015-02-04 Thread Felix Schumacher

Am 04.02.2015 um 14:21 schrieb Luc DALLEMANE:

Hi,

I'm back again with the problem :)

Firstly, I add the validationQuery and it works and I can see it in postgres 
logs.

But still not able to login after a while of inactivity

Now, after 15 min of waiting, I'm getting a socket connexion timeout, but seems 
logic after such a long period of trying to connect.

Thank you again for your ideas and haven't found a solution.
You might try to enable keepalive on your postgresql connection. 
Connection porperties can be specified with the attribute 
connectionProperties (at least according to 
http://commons.apache.org/proper/commons-dbcp/configuration.html) or in 
the jdbc url jdbc://...?tcpKeepAlive=true. You can even specify the 
timeout for connnecting to your database.


Regards
 Felix


Regards, Luc.

De : Konstantin Kolinko knst.koli...@gmail.com
Envoyé : mardi 3 février 2015 12:33
À : Tomcat Users List
Objet : Re: JDBC authentication problem

2015-02-03 14:29 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:

Hi,

Thanks for the reply, I tried to add the options you told me about 
(testWhileIdle, timeBetweenEvictionRunsMillis, and maxConnLifetimeMillis), but 
I'm still unable to log after un hour ...

Do you have validationQuery configured?  testOnBorrow, testWhileIdle
do not work without it.


Best regards,
Konstantin Kolinko

-
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




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



RE: JDBC authentication problem

2015-02-04 Thread Luc DALLEMANE

Hi,

I'm back again with the problem :) 

Firstly, I add the validationQuery and it works and I can see it in postgres 
logs.

But still not able to login after a while of inactivity 

Now, after 15 min of waiting, I'm getting a socket connexion timeout, but seems 
logic after such a long period of trying to connect. 

Thank you again for your ideas and haven't found a solution.

Regards, Luc.

De : Konstantin Kolinko knst.koli...@gmail.com
Envoyé : mardi 3 février 2015 12:33
À : Tomcat Users List
Objet : Re: JDBC authentication problem

2015-02-03 14:29 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,

 Thanks for the reply, I tried to add the options you told me about 
 (testWhileIdle, timeBetweenEvictionRunsMillis, and maxConnLifetimeMillis), 
 but I'm still unable to log after un hour ...

Do you have validationQuery configured?  testOnBorrow, testWhileIdle
do not work without it.


Best regards,
Konstantin Kolinko

-
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: JDBC authentication problem

2015-02-03 Thread Luc DALLEMANE
Hi,

Thanks for the reply, I tried to add the options you told me about 
(testWhileIdle, timeBetweenEvictionRunsMillis, and maxConnLifetimeMillis), but 
I'm still unable to log after un hour ... 

I'm having this problem for 2 weeks and still unable to find a way to go around 
this problem...

I thought that the firewall dropped my connexions, but no solutions for this 
problem seems to work. 

(again I assume it is the firewall, that corrupts your connections and I 
assume you are using a connection pool managed by tomcat). You were right, I'm 
using it.

The only thing I haven't test is to not use the pool, but this doesn't seems a 
really good option for me.

I'm new to Tomcat so I don't know it very well, but this should have worked...

We are thinking of asking a guy from another company (who knows tomcat and 
network better than I), because nobody have a solution for this in mine.

Thank you for your help !! And if you have another idea... you're welcome again.

Regards, Luc.



De : Felix Schumacher felix.schumac...@internetallee.de
Envoyé : lundi 2 février 2015 18:59
À : Tomcat Users List
Objet : Re: JDBC authentication problem

Am 02.02.2015 um 17:03 schrieb Luc DALLEMANE:
 Thanks for the reply,

 No I haven't got any exceptions, and there is no more logs until I restart 
 tomcat manually.
  From the web page, you can see that it keeps loading the page 
 indefinitely... and never tells if the authentication fails or not. (This 
 part works when I restart tomcat).

 I'm using the DataSourceRealm provided with Tomcat7.
First of all, I wouldn't trust the network guys :) The firewall might be
OK, but OK might mean, that it drops connections, when they are idle for
too long.

That said, you have a few options to drive around such a limitation.

You could set testWhileIdle to true, so that you generate network
traffic and thus keep open the firewall (again I assume it is the
firewall, that corrupts your connections and I assume you are using a
connection pool managed by tomcat). I believe you have to set
timeBetweenEvictionRunsMillis to a postive value, or no idle testing
will be done.

You might try the maxConnLifetimeMillis setting, so that old
connections from the pool will not be used.

You might try to size the pool, so that it keeps no idle connections
(but why should I use a pool then?).

Hope this helps
  Felix


 -Message d'origine-
 De : Christopher Schultz [mailto:ch...@christopherschultz.net]
 Envoyé : lundi 2 février 2015 16:19
 À : Tomcat Users List
 Objet : Re: JDBC authentication problem

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Luc,

 On 2/2/15 6:11 AM, Luc DALLEMANE wrote:
 I tried to switch to DataSourceRealm but my problem is here again.

 After a while, the authentication is still impossible. Maybe i have
 missed something about the DataSource in the doc but I'm able to login
 several times. It's only after about one hour of inactivity.

 The network admin looked the firewall config and told me the config
 was OK ...
 Are there any exceptions in the log files? Or do you simply get a refused 
 authentication? Are you using Tomcat's built-in authenticator?
 Which one?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJUz5VWAAoJEBzwKT+lPKRY7i8P/jS1NIa4jKCrONMdyxSpibQo
 Ce+s6EO3li8LY8TqTvcB6F6lABHMvFu7izDkA9K5wdAfUX0zqNTliUnfEUy+rf2C
 92NEeyoXKVkphaFnhYhfBXU6c4DQDhSvq+ZNb8r3exH0y7fbclZzDG/6d6YnxL3i
 DHUiq/iPG5xB+5H4a6WQgudQoKiMC+rEmrXhkYGnAbTscw43tkQqkyW7KlkIF610
 CUultPN3gw1coAVSHXulzW+AqIUCM1GOtsY2qT5xobGTM3oO/YsE6YCRCQC6s8ZJ
 Sa6TC1sMCnqALS1T5rJrwHU9jCN7pPRT0SjToU6gPF8rIzVzejAunJpiwKtTNwW3
 8tuAfaTLOwBTAq1ddF8rwk93pFB2EYM3htWQ0u6GzLsWHDqBU0zkAkYz6m/6qvfR
 egZMFuCkPjmxmoObbuAwHZ73HfosXeGUwkGeXgeD3a6DD5g7wXlSXGixkZ65Hifi
 FyM/RmUat4IVOiIXe2poVmwiOnFL9hDarkWCrybpTH4xlPhgv98feKvKxudkJsM/
 o6U3lpB/q//SEQ3PGuddJX1znCjXkIWFlfqZ3avrB5OTIuxAdTrSC5GaSiTK+L48
 ieN8K6SxnOo5pmdgoTcFiYXiH0qvIOFJ0Ez36+ZE3X987ysTvylxMJdpP4y81miO
 TY2PAwTlHfFyUFLQahlg
 =3+Xk
 -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



-
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: JDBC authentication problem

2015-02-03 Thread Konstantin Kolinko
2015-02-03 14:29 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,

 Thanks for the reply, I tried to add the options you told me about 
 (testWhileIdle, timeBetweenEvictionRunsMillis, and maxConnLifetimeMillis), 
 but I'm still unable to log after un hour ...

Do you have validationQuery configured?  testOnBorrow, testWhileIdle
do not work without it.


Best regards,
Konstantin Kolinko

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



RE: JDBC authentication problem

2015-02-02 Thread Luc DALLEMANE
Hi,

I tried to switch to DataSourceRealm but my problem is here again. 

After a while, the authentication is still impossible. Maybe i have missed 
something about the DataSource in the doc but I'm able to login several times. 
It's only after about one hour of inactivity.

The network admin looked the firewall config and told me the config was OK ...

So, if you have any idea, you're welcome !

Regards, Luc.

De : Luc DALLEMANE ldallem...@alaloop.com
Envoyé : vendredi 30 janvier 2015 15:39
À : Tomcat Users List
Objet : RE: JDBC authentication problem

Ok, I'm going to try this.

Hope this will help to solve my problem.

Regards Luc D.


-Message d'origine-
De : Christopher Schultz [mailto:ch...@christopherschultz.net]
Envoyé : vendredi 30 janvier 2015 15:24
À : Tomcat Users List
Objet : Re: JDBC authentication problem

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 1/30/15 9:05 AM, Luc DALLEMANE wrote:
 Thanks for the reply, it is the JDBCRealm not the data source.

Your Resource configuration is therefore ignored.

The JDBCRealm should really not be used at all. Switch to DataSourceRealm. If 
you don't like using your application's DataSource for authentication (some 
folks don't), then create a second DataSource just for authentication.

The DataSourceRealm has some significant advantages, such as being able to use 
a configurable pool of Connections, instead of a single Connection like 
JDBCRealm does. This improved performance and allows for re-connections, etc. I 
think this will fix your immediate problem plus eliminate some other problems 
down the line (like performance).


- -chris

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



Re: JDBC authentication problem

2015-02-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 2/2/15 6:11 AM, Luc DALLEMANE wrote:
 I tried to switch to DataSourceRealm but my problem is here again.
 
 After a while, the authentication is still impossible. Maybe i
 have missed something about the DataSource in the doc but I'm able
 to login several times. It's only after about one hour of
 inactivity.
 
 The network admin looked the firewall config and told me the
 config was OK ...

Are there any exceptions in the log files? Or do you simply get a
refused authentication? Are you using Tomcat's built-in authenticator?
Which one?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUz5VWAAoJEBzwKT+lPKRY7i8P/jS1NIa4jKCrONMdyxSpibQo
Ce+s6EO3li8LY8TqTvcB6F6lABHMvFu7izDkA9K5wdAfUX0zqNTliUnfEUy+rf2C
92NEeyoXKVkphaFnhYhfBXU6c4DQDhSvq+ZNb8r3exH0y7fbclZzDG/6d6YnxL3i
DHUiq/iPG5xB+5H4a6WQgudQoKiMC+rEmrXhkYGnAbTscw43tkQqkyW7KlkIF610
CUultPN3gw1coAVSHXulzW+AqIUCM1GOtsY2qT5xobGTM3oO/YsE6YCRCQC6s8ZJ
Sa6TC1sMCnqALS1T5rJrwHU9jCN7pPRT0SjToU6gPF8rIzVzejAunJpiwKtTNwW3
8tuAfaTLOwBTAq1ddF8rwk93pFB2EYM3htWQ0u6GzLsWHDqBU0zkAkYz6m/6qvfR
egZMFuCkPjmxmoObbuAwHZ73HfosXeGUwkGeXgeD3a6DD5g7wXlSXGixkZ65Hifi
FyM/RmUat4IVOiIXe2poVmwiOnFL9hDarkWCrybpTH4xlPhgv98feKvKxudkJsM/
o6U3lpB/q//SEQ3PGuddJX1znCjXkIWFlfqZ3avrB5OTIuxAdTrSC5GaSiTK+L48
ieN8K6SxnOo5pmdgoTcFiYXiH0qvIOFJ0Ez36+ZE3X987ysTvylxMJdpP4y81miO
TY2PAwTlHfFyUFLQahlg
=3+Xk
-END PGP SIGNATURE-

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



Re: JDBC Fails to connect to SQL Server

2015-02-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Aniket,

On 2/2/15 3:09 AM, Aniket Bhoi wrote:
 On Fri, Jan 30, 2015 at 10:37 PM, Christopher Schultz  
 ch...@christopherschultz.net wrote:
 
 -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
 
 Aniket,
 
 On 1/30/15 10:01 AM, Aniket Bhoi wrote:
 I have Apache Solr hosted on Tomcat 6.
 
 There have been no changes to the code on Tomcat
 whatsoever.However for the last few days I now see this error
 in the Log files:
 
 SEVERE: Full Import failed Throwable occurred: 
 org.apache.solr.handler.dataimport.DataImportHandlerException: 
 Unable to execute query: SELECT ID, ENTRY_TYPE_REF,
 PROFILE_REF, ITEM_REF, TITLE, ABSTRACT, SOLUTION,
 SOLUTION_HTML, FREE_TEXT, DATE_UPDATED, ENTRY_TYPE,
 PROFILE_TYPE, SERVICE_TYPE FROM INFRA_KO_V Processing Document
 # 1
 
 [snip]
 
 *Caused by: com.microsoft.sqlserver.jdbc.SQLServerException:
 The driver could not establish a secure connection to SQL
 Server by using Secure Sockets Layer (SSL) encryption. Error:
 SQL Server did not return a response. The connection has been
 closed..* at
 
 com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1368)



 
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1412)
 
 
 What does your Resource definition look like in either
 server.xml or (better) context.xml?
 
 - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment:
 GPGTools - http://gpgtools.org
 
 
 
 Thanks Jeff,
 
 Let me check if there has been any such problem.
 
 Hi Chris,
 
 I do not have the resource configured in either context.xml or in 
 server.xml,its in Solr's data-config.xml,its picked up from there
 during data import.
 
 dataSource type=JdbcDataSource 
 driver=com.microsoft.sqlserver.jdbc.SQLServerDriver 
 url=jdbc:sqlserver://xxx-xxx:1433;databaseName=xxx user=xxx 
 password=xxx/

Then this has nothing to do with Tomcat: you are using Solr's
configuration with Microsoft's JDBC driver. You might get some help
here due to the general nature of connection pools, firewalls, etc.,
but this isn't a Tomcat problem.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUz5PQAAoJEBzwKT+lPKRYd4UP/2Vajfe7n8bFGGWsIDTC0J5O
8o+xgf5Hfcp8oPVYcV0vXy1M1Ugb5cBSvDBOHpkCvCShR9wJXXyh/KFjA9amiM7A
D3Fn/LSumTDkjM/U/rOmiPBQfe5p+EBeDh8xEK7DV0O55cvJ2cgKWuNiRpU6uQ3a
elAxnPOyl4Ekv/pzrykFnKMsqQbzAyO7j+4EDwfAD9//bpM0QWeUHJwyA3h/r4aE
5zfasvfwa/ZnKx5teQeUy9bpYmIFwPshS+VH85Gc+D8x4yQ+Oq8U1cp9H3tKctDo
HBUqs/Of7UsqqWD8Jvkl3t/T7QZgJLbx56f6VCCykUYBerivpSI9oK/MZFtlK6Nv
TQPMs5u6TnDfFRLoogRER6C+xIJWXmJukb2WpoyDkhVZWEwnzvGnVyarXP7TNa9m
C0Wm/2xozTkziDWpkS1oJ1/nT4zWTqX6uR8415leQ0mU4V9g1gQUouap7Ja1WrRN
0FArAC+XcT3estl/nIIAT9P3zHVYq2TKs9FNMTJBCaHCfxu4SV/ZaZzJOEZiTe0d
wnTXIu4Vw6cdGGjpZjQPP3sDrCAX6pvukQX6IwOLmhjr0Kvo/OUoZslQdSLt48nL
r26yEA+7iLybqZvJ3SDB8XnpnQyvcuJXmpfQjqqy1blEKfXGhsaItdWP+5/ZBxDH
MUr2jmJ2WajRD+EhmROo
=yyhZ
-END PGP SIGNATURE-

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



RE: JDBC authentication problem

2015-02-02 Thread Luc DALLEMANE

Thanks for the reply,

No I haven't got any exceptions, and there is no more logs until I restart 
tomcat manually.
From the web page, you can see that it keeps loading the page indefinitely... 
and never tells if the authentication fails or not. (This part works when I 
restart tomcat). 

I'm using the DataSourceRealm provided with Tomcat7.


-Message d'origine-
De : Christopher Schultz [mailto:ch...@christopherschultz.net] 
Envoyé : lundi 2 février 2015 16:19
À : Tomcat Users List
Objet : Re: JDBC authentication problem

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 2/2/15 6:11 AM, Luc DALLEMANE wrote:
 I tried to switch to DataSourceRealm but my problem is here again.
 
 After a while, the authentication is still impossible. Maybe i have 
 missed something about the DataSource in the doc but I'm able to login 
 several times. It's only after about one hour of inactivity.
 
 The network admin looked the firewall config and told me the config 
 was OK ...

Are there any exceptions in the log files? Or do you simply get a refused 
authentication? Are you using Tomcat's built-in authenticator?
Which one?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUz5VWAAoJEBzwKT+lPKRY7i8P/jS1NIa4jKCrONMdyxSpibQo
Ce+s6EO3li8LY8TqTvcB6F6lABHMvFu7izDkA9K5wdAfUX0zqNTliUnfEUy+rf2C
92NEeyoXKVkphaFnhYhfBXU6c4DQDhSvq+ZNb8r3exH0y7fbclZzDG/6d6YnxL3i
DHUiq/iPG5xB+5H4a6WQgudQoKiMC+rEmrXhkYGnAbTscw43tkQqkyW7KlkIF610
CUultPN3gw1coAVSHXulzW+AqIUCM1GOtsY2qT5xobGTM3oO/YsE6YCRCQC6s8ZJ
Sa6TC1sMCnqALS1T5rJrwHU9jCN7pPRT0SjToU6gPF8rIzVzejAunJpiwKtTNwW3
8tuAfaTLOwBTAq1ddF8rwk93pFB2EYM3htWQ0u6GzLsWHDqBU0zkAkYz6m/6qvfR
egZMFuCkPjmxmoObbuAwHZ73HfosXeGUwkGeXgeD3a6DD5g7wXlSXGixkZ65Hifi
FyM/RmUat4IVOiIXe2poVmwiOnFL9hDarkWCrybpTH4xlPhgv98feKvKxudkJsM/
o6U3lpB/q//SEQ3PGuddJX1znCjXkIWFlfqZ3avrB5OTIuxAdTrSC5GaSiTK+L48
ieN8K6SxnOo5pmdgoTcFiYXiH0qvIOFJ0Ez36+ZE3X987ysTvylxMJdpP4y81miO
TY2PAwTlHfFyUFLQahlg
=3+Xk
-END PGP SIGNATURE-

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



Re: JDBC authentication problem

2015-02-02 Thread Felix Schumacher

Am 02.02.2015 um 17:03 schrieb Luc DALLEMANE:

Thanks for the reply,

No I haven't got any exceptions, and there is no more logs until I restart 
tomcat manually.
 From the web page, you can see that it keeps loading the page indefinitely... 
and never tells if the authentication fails or not. (This part works when I 
restart tomcat).

I'm using the DataSourceRealm provided with Tomcat7.
First of all, I wouldn't trust the network guys :) The firewall might be 
OK, but OK might mean, that it drops connections, when they are idle for 
too long.


That said, you have a few options to drive around such a limitation.

You could set testWhileIdle to true, so that you generate network 
traffic and thus keep open the firewall (again I assume it is the 
firewall, that corrupts your connections and I assume you are using a 
connection pool managed by tomcat). I believe you have to set 
timeBetweenEvictionRunsMillis to a postive value, or no idle testing 
will be done.


You might try the maxConnLifetimeMillis setting, so that old 
connections from the pool will not be used.


You might try to size the pool, so that it keeps no idle connections 
(but why should I use a pool then?).


Hope this helps
 Felix



-Message d'origine-
De : Christopher Schultz [mailto:ch...@christopherschultz.net]
Envoyé : lundi 2 février 2015 16:19
À : Tomcat Users List
Objet : Re: JDBC authentication problem

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 2/2/15 6:11 AM, Luc DALLEMANE wrote:

I tried to switch to DataSourceRealm but my problem is here again.

After a while, the authentication is still impossible. Maybe i have
missed something about the DataSource in the doc but I'm able to login
several times. It's only after about one hour of inactivity.

The network admin looked the firewall config and told me the config
was OK ...

Are there any exceptions in the log files? Or do you simply get a refused 
authentication? Are you using Tomcat's built-in authenticator?
Which one?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUz5VWAAoJEBzwKT+lPKRY7i8P/jS1NIa4jKCrONMdyxSpibQo
Ce+s6EO3li8LY8TqTvcB6F6lABHMvFu7izDkA9K5wdAfUX0zqNTliUnfEUy+rf2C
92NEeyoXKVkphaFnhYhfBXU6c4DQDhSvq+ZNb8r3exH0y7fbclZzDG/6d6YnxL3i
DHUiq/iPG5xB+5H4a6WQgudQoKiMC+rEmrXhkYGnAbTscw43tkQqkyW7KlkIF610
CUultPN3gw1coAVSHXulzW+AqIUCM1GOtsY2qT5xobGTM3oO/YsE6YCRCQC6s8ZJ
Sa6TC1sMCnqALS1T5rJrwHU9jCN7pPRT0SjToU6gPF8rIzVzejAunJpiwKtTNwW3
8tuAfaTLOwBTAq1ddF8rwk93pFB2EYM3htWQ0u6GzLsWHDqBU0zkAkYz6m/6qvfR
egZMFuCkPjmxmoObbuAwHZ73HfosXeGUwkGeXgeD3a6DD5g7wXlSXGixkZ65Hifi
FyM/RmUat4IVOiIXe2poVmwiOnFL9hDarkWCrybpTH4xlPhgv98feKvKxudkJsM/
o6U3lpB/q//SEQ3PGuddJX1znCjXkIWFlfqZ3avrB5OTIuxAdTrSC5GaSiTK+L48
ieN8K6SxnOo5pmdgoTcFiYXiH0qvIOFJ0Ez36+ZE3X987ysTvylxMJdpP4y81miO
TY2PAwTlHfFyUFLQahlg
=3+Xk
-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




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



Re: JDBC Fails to connect to SQL Server

2015-02-02 Thread Aniket Bhoi
On Fri, Jan 30, 2015 at 10:37 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Aniket,

 On 1/30/15 10:01 AM, Aniket Bhoi wrote:
  I have Apache Solr hosted on Tomcat 6.
 
  There have been no changes to the code on Tomcat whatsoever.However
  for the last few days I now see this error in the Log files:
 
  SEVERE: Full Import failed Throwable occurred:
  org.apache.solr.handler.dataimport.DataImportHandlerException:
  Unable to execute query: SELECT ID, ENTRY_TYPE_REF, PROFILE_REF,
  ITEM_REF, TITLE, ABSTRACT, SOLUTION, SOLUTION_HTML, FREE_TEXT,
  DATE_UPDATED, ENTRY_TYPE, PROFILE_TYPE, SERVICE_TYPE FROM
  INFRA_KO_V Processing Document # 1
 
  [snip]
 
  *Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The
  driver could not establish a secure connection to SQL Server by
  using Secure Sockets Layer (SSL) encryption. Error: SQL Server did
  not return a response. The connection has been closed..* at
 
 com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1368)
 
 
 at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1412)


 What does your Resource definition look like in either server.xml or
 (better) context.xml?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org



Thanks Jeff,

Let me check if there has been any such problem.

Hi Chris,

I do not have the resource configured in either context.xml or in
server.xml,its in Solr's data-config.xml,its picked up from there during
data import.

dataSource type=JdbcDataSource
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url=jdbc:sqlserver://xxx-xxx:1433;databaseName=xxx user=xxx
password=xxx/



-Aniket



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




Re: JDBC Fails to connect to SQL Server

2015-01-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Aniket,

On 1/30/15 10:01 AM, Aniket Bhoi wrote:
 I have Apache Solr hosted on Tomcat 6.
 
 There have been no changes to the code on Tomcat whatsoever.However
 for the last few days I now see this error in the Log files:
 
 SEVERE: Full Import failed Throwable occurred: 
 org.apache.solr.handler.dataimport.DataImportHandlerException:
 Unable to execute query: SELECT ID, ENTRY_TYPE_REF, PROFILE_REF,
 ITEM_REF, TITLE, ABSTRACT, SOLUTION, SOLUTION_HTML, FREE_TEXT,
 DATE_UPDATED, ENTRY_TYPE, PROFILE_TYPE, SERVICE_TYPE FROM
 INFRA_KO_V Processing Document # 1
 
 [snip]
 
 *Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The
 driver could not establish a secure connection to SQL Server by
 using Secure Sockets Layer (SSL) encryption. Error: SQL Server did
 not return a response. The connection has been closed..* at 
 com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1368)

 
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1412)


What does your Resource definition look like in either server.xml or
(better) context.xml?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUy7o3AAoJEBzwKT+lPKRYYuIP/jxc0viCEoNKl+rXg5i7FrnZ
1LSYOevInM8aWB8Fm5gnzTJ0zv/VFAcNGUaqwrAcVNNy2P2o5J+Jb2RrODF3JvXP
HuCdwyOkSQLfEtFN4jtkhcjPL+54NVDFybVsDDY1/030X4wHgI7vB2upsdeAD5/H
Sa73iHE5K3sM6aUmoxrzQLcB3riokCDzuA1tqxcYDEugcJ+wcmvULd8oc2DNKh0V
hAa4S9vVR4Uy+x+C81gUVFYr62jghpHPajOdbF88Yryko8lhfASSvawMk0qKWLQ4
Tf0FY72Hcp7aW/bgVD44CUtvhjpY6j70QJCWE4rHq9/5T04fFPkYOZgxExj0GInX
6NfNb6JUDW88AkbpS3NXlxa6YZuyquQu42yyFZsze/jbpUrUfBXOjWD0JRQ9kHpe
XfjTNMOeeMmYLDLR86nMKuamUukwexFgpTLvdr/iCf0qtJUViBitVL5U8ALoAJdb
b0u/Wq93TXKP8TKh8gP1vWN0Sa29d7e/8W88cGWnHerugJRamGSGmFcbClOL/S77
+CMpzLsPo6w9lBMNp8i0nUkJYc+4VkkrVziS0rv6etUsCfaZw6k9W6hFW6QIq3vo
FcWpa5r5zFaTG+7NhIyvJmBykPUSBycHE5tDqGIMRHzNRsSWXCyRkTb9DMr0JJSy
IdXis+j60OPCTlFbBCkC
=+aqL
-END PGP SIGNATURE-

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



Re: JDBC Fails to connect to SQL Server

2015-01-30 Thread Jeff Kohut
On Fri, Jan 30, 2015 at 9:01 AM, Aniket Bhoi aniket.b...@gmail.com wrote:

 Hi,

 I have Apache Solr hosted on Tomcat 6.

 There have been no changes to the code on Tomcat whatsoever.However for the
 last few days I now see this error in the Log files:

 SEVERE: Full Import failed
 Throwable occurred:
 org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to
 execute query: SELECT ID, ENTRY_TYPE_REF, PROFILE_REF, ITEM_REF, TITLE,
 ABSTRACT, SOLUTION, SOLUTION_HTML, FREE_TEXT, DATE_UPDATED, ENTRY_TYPE,
 PROFILE_TYPE, SERVICE_TYPE FROM INFRA_KO_V Processing Document # 1
 at

 org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:72)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.init(JdbcDataSource.java:251)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:208)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:39)
 at

 org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:58)
 at

 org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:71)
 at

 org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:233)
 at

 org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:579)
 at

 org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:260)
 at
 org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:184)
 at

 org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:334)
 at

 org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:392)
 at

 org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:373)
 *Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver
 could not establish a secure connection to SQL Server by using Secure
 Sockets Layer (SSL) encryption. Error: SQL Server did not return a
 response. The connection has been closed..*
 at

 com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1368)
 at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1412)
 at

 com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1058)
 at

 com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:833)
 at

 com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)
 at

 com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource$1.call(JdbcDataSource.java:160)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource$1.call(JdbcDataSource.java:127)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource.getConnection(JdbcDataSource.java:361)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource.access$200(JdbcDataSource.java:39)
 at

 org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.init(JdbcDataSource.java:238)
 ... 11 more
 *Caused by: java.io.IOException: SQL Server did not return a response. The
 connection has been closed.*
 at

 com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:513)
 at

 com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:570)
 at

 com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:562)
 at

 com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:757)
 at

 com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:745)
 at com.ibm.jsse2.b.a(b.java:286)
 at com.ibm.jsse2.b.a(b.java:67)
 at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:313)
 at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:63)
 at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:316)
 at com.ibm.jsse2.SSLSocketImpl.startHandshake(SSLSocketImpl.java:220)
 at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1379)
 ... 20 more

 I can confirmthat there has been no change to firewall settings etc .

 Need help on this.

 Regards
 Aniket


Assuming no changes on the calling side (Application/OS), is it possible
that the Windows MS SQL server has been recently patched and restarted.
There are periodic OS, security updates to Windows and sometimes they
involve Certificates (i.e. SSL). It could be that a previously allowed
Certificate is no longer working due to expiration, encryption length no
longer being sufficient, etc...


RE: JDBC authentication problem

2015-01-30 Thread Luc DALLEMANE
Thanks for the reply, it is the JDBCRealm not the data source.

I have set this password for test only but it will be changed when everything 
will be ok and in production . (But didn't saw i had paste it ...) 

-Message d'origine-
De : Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Envoyé : vendredi 30 janvier 2015 14:52
À : Tomcat Users List
Objet : Re: JDBC authentication problem

2015-01-30 16:45 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,


 I'm facing a problem with my web application.


 I'm using Tomcat 7.0.56, Java 1.8, Postgres 9.4 and Debian 7.

 The application is configured as followed :


 The web server is located in a DMZ.

 The database server is located in our LAN.

 To communicate with each other, a firewall has been setup (Cisco asa 
 firewall)


 To authenticate an user to the website, I use the tomcat JDBC Realm.

1. Realm configuration =?
Is it JDBCRealm or DataSourceRealm? If it is the former, then your Resource 
is not used at all.

2. Posting the actual password on a public mailing list? Consider it 
compromised.


 At the beginning, everything works fine, but after about an hour of 
 inactivity, its impossible to authenticate again :

 Tomcat process seems to be running but doesn't log anything and doesn't 
 answer any other requests.


 The firewall is rejecting the connection with the following message : 
 Deny TCP (no connection) from WEB/50790 to DB/5432 FIN ACK on 
 interface DMZ_clients


 I thought, the problem was after a while, if tomcat connexions were not used, 
 the firewall would drop them.

 So, I tried to add keepAlive time-outs (tomcat site, postgres side, ) but 
 none of them worked :


 Here is the tomcat context.xml :


  Resource name=jdbc/elkar auth=Container
 type=javax.sql.DataSource 
 driverClassName=org.postgresql.Driver
[...]
 /


 The postgresql.conf :


 # - TCP Keepalives -
 # see man 7 tcp for details

 #tcp_keepalives_idle = 300  # TCP_KEEPIDLE, in seconds;
  # 0 selects the system 
 default
 #tcp_keepalives_interval = 0# TCP_KEEPINTVL, in seconds;
  # 0 selects the 
 system default #tcp_keepalives_count = 0


 And finally, the Sysctl.conf :


 net.ipv4.tcp_keepalive_time = 900
 net.ipv4.tcp_keepalive_intvl = 60
 net.ipv4.tcp_keepalive_probes = 9



 Before that, the application was tested without using the firewall and 
 everything worked fine.


 If you have any idea of why this is happening, I haven't found a solution yet.


 Regards, Luc D.


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



Re: JDBC authentication problem

2015-01-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 1/30/15 9:05 AM, Luc DALLEMANE wrote:
 Thanks for the reply, it is the JDBCRealm not the data source.

Your Resource configuration is therefore ignored.

The JDBCRealm should really not be used at all. Switch to
DataSourceRealm. If you don't like using your application's DataSource
for authentication (some folks don't), then create a second DataSource
just for authentication.

The DataSourceRealm has some significant advantages, such as being
able to use a configurable pool of Connections, instead of a single
Connection like JDBCRealm does. This improved performance and allows
for re-connections, etc. I think this will fix your immediate problem
plus eliminate some other problems down the line (like performance).

 I have set this password for test only but it will be changed when 
 everything will be ok and in production . (But didn't saw i had
 paste it ...)

Good. :)

- -chris

 -Message d'origine- De : Konstantin Kolinko
 [mailto:knst.koli...@gmail.com] Envoyé : vendredi 30 janvier 2015
 14:52 À : Tomcat Users List Objet : Re: JDBC authentication
 problem
 
 2015-01-30 16:45 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,
 
 
 I'm facing a problem with my web application.
 
 
 I'm using Tomcat 7.0.56, Java 1.8, Postgres 9.4 and Debian 7.
 
 The application is configured as followed :
 
 
 The web server is located in a DMZ.
 
 The database server is located in our LAN.
 
 To communicate with each other, a firewall has been setup (Cisco
 asa firewall)
 
 
 To authenticate an user to the website, I use the tomcat JDBC
 Realm.
 
 1. Realm configuration =? Is it JDBCRealm or DataSourceRealm? If it
 is the former, then your Resource is not used at all.
 
 2. Posting the actual password on a public mailing list? Consider
 it compromised.
 
 
 At the beginning, everything works fine, but after about an hour
 of inactivity, its impossible to authenticate again :
 
 Tomcat process seems to be running but doesn't log anything and
 doesn't answer any other requests.
 
 
 The firewall is rejecting the connection with the following
 message : Deny TCP (no connection) from WEB/50790 to DB/5432 FIN
 ACK on interface DMZ_clients
 
 
 I thought, the problem was after a while, if tomcat connexions
 were not used, the firewall would drop them.
 
 So, I tried to add keepAlive time-outs (tomcat site, postgres
 side, ) but none of them worked :
 
 
 Here is the tomcat context.xml :
 
 
 Resource name=jdbc/elkar auth=Container 
 type=javax.sql.DataSource
 driverClassName=org.postgresql.Driver
 [...]
 /
 
 
 The postgresql.conf :
 
 
 # - TCP Keepalives - # see man 7 tcp for details
 
 #tcp_keepalives_idle = 300  # TCP_KEEPIDLE, in
 seconds; # 0 selects the system default #tcp_keepalives_interval
 = 0# TCP_KEEPINTVL, in seconds; # 0 selects the 
 system default #tcp_keepalives_count = 0
 
 
 And finally, the Sysctl.conf :
 
 
 net.ipv4.tcp_keepalive_time = 900 net.ipv4.tcp_keepalive_intvl =
 60 net.ipv4.tcp_keepalive_probes = 9
 
 
 
 Before that, the application was tested without using the
 firewall and everything worked fine.
 
 
 If you have any idea of why this is happening, I haven't found a
 solution yet.
 
 
 Regards, Luc D.
 
 
 -

 
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
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUy5PtAAoJEBzwKT+lPKRYqI4P/0kZuZuJCopHe88BXTNj/1O7
cEdmsoJq/7Ba/kLZ3/xqElzAjOQfnWK22GTCVGdsEou95MB4MspAcD8unGJgKiKs
b1Ko/ixTN8irY7w5QGbXAv52NX9N/h9vrsr/EASxe/A8nSCSP9sjdh9Qr2OAOXBC
2FAMcpS3blpik78nFBBPkwJY5L3nhbkcEq0AMSqGGsfo+WJPFUtXBtzPO4JoAtGJ
8d1HxDd8PsL0tOMsqdIbJ9EqfW7Fano7ajk2Cu4gczGA3G3XlwsuHo5Glq9MSkzW
DZYqxW3JwpgvMQO2o/vZyZcK7aqADqaMNE+sgaaAvRYbHzMtOTqCLebfLHqst17q
eg+85Pm/5815SVvbW7kQX2Pv2bAs+bzyz7zdWk4KFdUaU1sD3bwNtkgWewNB/Gex
jbZXLbKK27EFPd8M8W8PWd0x11veJ5hHEPyCWwM2njF5OoB3OSumY+yPUTWg/9oD
7xcFWjntybTHWpOcE5uxtPSzZqz1ctijiBvYo5DI8qh0W0CVsFYGGYmBucPcMc5M
PapWz+jYPgqzxDIHq27jpqmDqch6h1EQCmj3rGriWifxl9qTw4WtDgL/9sEmmkjd
NfysWjaNW+nqkt8qg6pmuHs0K1PLp2IO7C9jftE3jJ/lIZCy+yo+LSe2U7mhUvn9
Qj6PY8Ds4aaN0GzgUan/
=8zAr
-END PGP SIGNATURE-

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



Re: JDBC authentication problem

2015-01-30 Thread Konstantin Kolinko
2015-01-30 16:45 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,


 I'm facing a problem with my web application.


 I'm using Tomcat 7.0.56, Java 1.8, Postgres 9.4 and Debian 7.

 The application is configured as followed :


 The web server is located in a DMZ.

 The database server is located in our LAN.

 To communicate with each other, a firewall has been setup (Cisco asa firewall)


 To authenticate an user to the website, I use the tomcat JDBC Realm.

1. Realm configuration =?
Is it JDBCRealm or DataSourceRealm? If it is the former, then your
Resource is not used at all.

2. Posting the actual password on a public mailing list? Consider it
compromised.


 At the beginning, everything works fine, but after about an hour of 
 inactivity, its impossible to authenticate again :

 Tomcat process seems to be running but doesn't log anything and doesn't 
 answer any other requests.


 The firewall is rejecting the connection with the following message : Deny 
 TCP (no connection) from WEB/50790 to DB/5432 FIN ACK on interface DMZ_clients


 I thought, the problem was after a while, if tomcat connexions were not used, 
 the firewall would drop them.

 So, I tried to add keepAlive time-outs (tomcat site, postgres side, ) but 
 none of them worked :


 Here is the tomcat context.xml :


  Resource name=jdbc/elkar auth=Container
 type=javax.sql.DataSource 
 driverClassName=org.postgresql.Driver
[...]
 /


 The postgresql.conf :


 # - TCP Keepalives -
 # see man 7 tcp for details

 #tcp_keepalives_idle = 300  # TCP_KEEPIDLE, in seconds;
  # 0 selects the system 
 default
 #tcp_keepalives_interval = 0# TCP_KEEPINTVL, in seconds;
  # 0 selects the system 
 default
 #tcp_keepalives_count = 0


 And finally, the Sysctl.conf :


 net.ipv4.tcp_keepalive_time = 900
 net.ipv4.tcp_keepalive_intvl = 60
 net.ipv4.tcp_keepalive_probes = 9



 Before that, the application was tested without using the firewall and 
 everything worked fine.


 If you have any idea of why this is happening, I haven't found a solution yet.


 Regards, Luc D.


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



RE: JDBC authentication problem

2015-01-30 Thread Luc DALLEMANE
Ok, I'm going to try this. 

Hope this will help to solve my problem.

Regards Luc D.

-Message d'origine-
De : Christopher Schultz [mailto:ch...@christopherschultz.net] 
Envoyé : vendredi 30 janvier 2015 15:24
À : Tomcat Users List
Objet : Re: JDBC authentication problem

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Luc,

On 1/30/15 9:05 AM, Luc DALLEMANE wrote:
 Thanks for the reply, it is the JDBCRealm not the data source.

Your Resource configuration is therefore ignored.

The JDBCRealm should really not be used at all. Switch to DataSourceRealm. If 
you don't like using your application's DataSource for authentication (some 
folks don't), then create a second DataSource just for authentication.

The DataSourceRealm has some significant advantages, such as being able to use 
a configurable pool of Connections, instead of a single Connection like 
JDBCRealm does. This improved performance and allows for re-connections, etc. I 
think this will fix your immediate problem plus eliminate some other problems 
down the line (like performance).

 I have set this password for test only but it will be changed when 
 everything will be ok and in production . (But didn't saw i had paste 
 it ...)

Good. :)

- -chris

 -Message d'origine- De : Konstantin Kolinko 
 [mailto:knst.koli...@gmail.com] Envoyé : vendredi 30 janvier 2015
 14:52 À : Tomcat Users List Objet : Re: JDBC authentication problem
 
 2015-01-30 16:45 GMT+03:00 Luc DALLEMANE ldallem...@alaloop.com:
 Hi,
 
 
 I'm facing a problem with my web application.
 
 
 I'm using Tomcat 7.0.56, Java 1.8, Postgres 9.4 and Debian 7.
 
 The application is configured as followed :
 
 
 The web server is located in a DMZ.
 
 The database server is located in our LAN.
 
 To communicate with each other, a firewall has been setup (Cisco asa 
 firewall)
 
 
 To authenticate an user to the website, I use the tomcat JDBC Realm.
 
 1. Realm configuration =? Is it JDBCRealm or DataSourceRealm? If it is 
 the former, then your Resource is not used at all.
 
 2. Posting the actual password on a public mailing list? Consider it 
 compromised.
 
 
 At the beginning, everything works fine, but after about an hour of 
 inactivity, its impossible to authenticate again :
 
 Tomcat process seems to be running but doesn't log anything and 
 doesn't answer any other requests.
 
 
 The firewall is rejecting the connection with the following message : 
 Deny TCP (no connection) from WEB/50790 to DB/5432 FIN ACK on 
 interface DMZ_clients
 
 
 I thought, the problem was after a while, if tomcat connexions were 
 not used, the firewall would drop them.
 
 So, I tried to add keepAlive time-outs (tomcat site, postgres side, 
 ) but none of them worked :
 
 
 Here is the tomcat context.xml :
 
 
 Resource name=jdbc/elkar auth=Container 
 type=javax.sql.DataSource
 driverClassName=org.postgresql.Driver
 [...]
 /
 
 
 The postgresql.conf :
 
 
 # - TCP Keepalives - # see man 7 tcp for details
 
 #tcp_keepalives_idle = 300  # TCP_KEEPIDLE, in
 seconds; # 0 selects the system default #tcp_keepalives_interval
 = 0# TCP_KEEPINTVL, in seconds; # 0 selects the 
 system default #tcp_keepalives_count = 0
 
 
 And finally, the Sysctl.conf :
 
 
 net.ipv4.tcp_keepalive_time = 900 net.ipv4.tcp_keepalive_intvl =
 60 net.ipv4.tcp_keepalive_probes = 9
 
 
 
 Before that, the application was tested without using the firewall 
 and everything worked fine.
 
 
 If you have any idea of why this is happening, I haven't found a 
 solution yet.
 
 
 Regards, Luc D.
 
 
 -

 
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
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUy5PtAAoJEBzwKT+lPKRYqI4P/0kZuZuJCopHe88BXTNj/1O7
cEdmsoJq/7Ba/kLZ3/xqElzAjOQfnWK22GTCVGdsEou95MB4MspAcD8unGJgKiKs
b1Ko/ixTN8irY7w5QGbXAv52NX9N/h9vrsr/EASxe/A8nSCSP9sjdh9Qr2OAOXBC
2FAMcpS3blpik78nFBBPkwJY5L3nhbkcEq0AMSqGGsfo+WJPFUtXBtzPO4JoAtGJ
8d1HxDd8PsL0tOMsqdIbJ9EqfW7Fano7ajk2Cu4gczGA3G3XlwsuHo5Glq9MSkzW
DZYqxW3JwpgvMQO2o/vZyZcK7aqADqaMNE+sgaaAvRYbHzMtOTqCLebfLHqst17q
eg+85Pm/5815SVvbW7kQX2Pv2bAs+bzyz7zdWk4KFdUaU1sD3bwNtkgWewNB/Gex
jbZXLbKK27EFPd8M8W8PWd0x11veJ5hHEPyCWwM2njF5OoB3OSumY+yPUTWg/9oD
7xcFWjntybTHWpOcE5uxtPSzZqz1ctijiBvYo5DI8qh0W0CVsFYGGYmBucPcMc5M
PapWz+jYPgqzxDIHq27jpqmDqch6h1EQCmj3rGriWifxl9qTw4WtDgL/9sEmmkjd
NfysWjaNW+nqkt8qg6pmuHs0K1PLp2IO7C9jftE3jJ/lIZCy+yo+LSe2U7mhUvn9
Qj6PY8Ds4aaN0GzgUan/
=8zAr
-END PGP SIGNATURE-

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

Re: JDBC-Pool: Reconnect the connection upon failures; retry queries; etc.

2014-06-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Miro,

On 6/19/14, 9:42 AM, Miroslav Nachev wrote:
 Is it possible to configure JDBC-Pool for the following
 functionality or I need to write my own interceptors and
 Validator?
 
 - Retry N times to getConnection() for OnBorrow/OnConnect and
 WhileIdle; - Wait X ms between each Retry.

Why would you want to throttle reconnects?

Usually this kind of thing is supported by your JDBC driver for things
like failover, etc.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTovBHAAoJEBzwKT+lPKRYDbUQAJ77mRkG7AN38FR102n7Lddn
FTnjnsH5FHgY5uVImi71IEcsMssKqe4bAbEVqfcTz2iZBUMhbHpe2Ik4iehJ2YOi
R+xH60DLVjjHi0Mmb80VmuRLEp7E8dVj/bCiAGwmo3kFCNCsxXjdsN4V/1YR4cJA
o9HIV62uUgAlhSd4SRsthP0WbjXmTX0U5h+F2tCl29MkqwL8Fn/OXnWRqd1/FuQk
88u7dryQU4TZXSSioLLgNGdFRRNIdV5PZeqRA2hTylCjy2GFfCqG4IIIRRgsh32z
qUY627wksT+1hC6RQ3d6h551St1a1PFr82zgCvytKuoWL30yQFX7bc0lfr+fd18i
Vny3gN/OxDNIqBFmeedGT76Yf6k3UdKgtUeJ3SLDo0zWq7CUA/BYgaTz+Lgw8J2m
eKp/QfY18rgLFZg6c+W5vRxl1w9Pd3R30J+8Y28ZuU5xgYjF98hFxuEv2Oo+VqI7
4mH31uA4wVppx49L/xdR5eXL9w6HZuZlqiyAbdExv/aj4KvhNtYOyWMq8z+sg9Jr
KWMApBRnjJU1rIgZpUFWqVlbtJWFs7TAB270aa+445xbbOUDSRlanzNKpoIuRtxT
R3d+h6j6Onhqmx7DpeuMWOoJzG8UMOHYfezE++ZqM6lzGTQJxbyt30mKFSHgIR1A
vBY8ZJdn8wNBL9EIK/a4
=LXZC
-END PGP SIGNATURE-

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



Re: JDBC-Pool: Reconnect the connection upon failures; retry queries; etc.

2014-06-19 Thread Miroslav Nachev
Hi Chris,

There are 2 cases:

   - When we try to execute some statement and the connection is lost, we
   would like to retry some times, to show Popup Window to the client with
   notification, etc.
   - We have application, which depends on another database application. If
   the connection to Database is lost, then all applications must be shutdown.
   - All this problems, retries, etc., should be logged.



Miro.


On Thu, Jun 19, 2014 at 5:14 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Miro,

 On 6/19/14, 9:42 AM, Miroslav Nachev wrote:
  Is it possible to configure JDBC-Pool for the following
  functionality or I need to write my own interceptors and
  Validator?
 
  - Retry N times to getConnection() for OnBorrow/OnConnect and
  WhileIdle; - Wait X ms between each Retry.

 Why would you want to throttle reconnects?

 Usually this kind of thing is supported by your JDBC driver for things
 like failover, etc.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJTovBHAAoJEBzwKT+lPKRYDbUQAJ77mRkG7AN38FR102n7Lddn
 FTnjnsH5FHgY5uVImi71IEcsMssKqe4bAbEVqfcTz2iZBUMhbHpe2Ik4iehJ2YOi
 R+xH60DLVjjHi0Mmb80VmuRLEp7E8dVj/bCiAGwmo3kFCNCsxXjdsN4V/1YR4cJA
 o9HIV62uUgAlhSd4SRsthP0WbjXmTX0U5h+F2tCl29MkqwL8Fn/OXnWRqd1/FuQk
 88u7dryQU4TZXSSioLLgNGdFRRNIdV5PZeqRA2hTylCjy2GFfCqG4IIIRRgsh32z
 qUY627wksT+1hC6RQ3d6h551St1a1PFr82zgCvytKuoWL30yQFX7bc0lfr+fd18i
 Vny3gN/OxDNIqBFmeedGT76Yf6k3UdKgtUeJ3SLDo0zWq7CUA/BYgaTz+Lgw8J2m
 eKp/QfY18rgLFZg6c+W5vRxl1w9Pd3R30J+8Y28ZuU5xgYjF98hFxuEv2Oo+VqI7
 4mH31uA4wVppx49L/xdR5eXL9w6HZuZlqiyAbdExv/aj4KvhNtYOyWMq8z+sg9Jr
 KWMApBRnjJU1rIgZpUFWqVlbtJWFs7TAB270aa+445xbbOUDSRlanzNKpoIuRtxT
 R3d+h6j6Onhqmx7DpeuMWOoJzG8UMOHYfezE++ZqM6lzGTQJxbyt30mKFSHgIR1A
 vBY8ZJdn8wNBL9EIK/a4
 =LXZC
 -END PGP SIGNATURE-

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




Re: jdbc connection pool, hanging threads and same physical connection usage

2013-05-28 Thread Daniel Mikusa
On May 27, 2013, at 7:40 AM, Huub Sepers h.sep...@portbase.com wrote:

 Hi,
 
 
 
 We are experiencing some problems while using the tomcat jdbc pool.
 
 
 
 Tomcat version: apache-tomcat-7.0.29

Try the latest version.  Your's is pretty old.

 
 Pool settings:
 
 Resource name=PilDevDS auth=Container type=javax.sql.DataSource
 factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
 
testWhileIdle=true testOnBorrow=true
 testOnReturn=false validationQuery=SELECT 1 FROM PIL_USERS
 
validationInterval=3
 timeBetweenEvictionRunsMillis=3 maxActive=100 minIdle=10
 maxWait=1
 
initialSize=10 removeAbandonedTimeout=60
 removeAbandoned=true logAbandoned=true
 minEvictableIdleTimeMillis=3
 
jmxEnabled=true
 
 
 jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionStat
 e;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer
 
username=PCS password=xxx
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@somehost /

Looks OK.


 Under heavy load we regularly see a thread waiting for response on a
 socketRead.
 
 Furthermore we see one or more threads trying to lock the same physical
 connection as used by the 'hanging thread'.
 
 See threaddump excerpt further on for an example.
 
 Questions:
 
 -  How is it possible that a thread tries to get a lock on a
 physical connection which is part of a pooled connection which is not
 idle?
 
 -  The 'poolcleaner' also hangs as it is trying to clean the
 'hanging connection'. This would mean that one hanging thread will bring
 the pool to its knees?

I don't think the threads are doing quite what you think they are doing.  See 
below.


 
 Threaddump excerpt:
 
 http-bio-8280-exec-148 - Thread t@265
 
   java.lang.Thread.State: RUNNABLE
 
at java.net.SocketInputStream.socketRead0(Native Method)

This is reading from the network.  Hard to say why exactly.  Is your network 
slow?  How much data are you pulling back through the connection?  

at java.net.SocketInputStream.read(SocketInputStream.java:129)
at oracle.net.ns.Packet.receive(Packet.java:300)
at oracle.net.ns.DataPacket.receive(DataPacket.java:106)
at 
 oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:260)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:185)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:102)
at 
 oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketI
 nputStreamWrapper.java:124)
at 
 oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStream
 Wrapper.java:80)
at 
 oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:290)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at 
 oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.jav
 a:207)
at 
 oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatem
 ent.java:1044)
at 
 oracle.jdbc.driver.OraclePreparedStatement.executeForRowsWithTimeout(Ora
 clePreparedStatement.java:10143)
 at 
 oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedSt
 atement.java:10249)
 
- locked 14d02b3 (a oracle.jdbc.driver.T4CConnection)

This is occurring in the Oracle driver, not the connection pool.  Sorry, I 
can't really comment as to why it's locking here as I don't have the code.

at 
 oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:230)

snip

The rest of this stack trace doesn't seem to reference the connection pool.  I 
don't see org.apache.tomcat.jdbc.* listed anywhere. How is your application 
configured to get a connection from the connection pool?  Is it possible that 
it's getting the connection some other way, not properly closing / returning 
the connection to the pool or unwrapping and accessing the underlying 
connection?

 
 http-bio-8280-exec-206 - Thread t@324
 
   java.lang.Thread.State: BLOCKED
 
at 
 oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnectio
 n.java:3461)
- waiting to lock 14d02b3 (a oracle.jdbc.driver.T4CConnection) 
 owned by http-bio-8280-exec-148 t@265

Again, this is blocking in the driver.

at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
 org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
at 
 

Re: [jdbc-pool] Transaction left open by the connection validation mechanism ?

2013-01-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pascal,

On 1/3/13 12:49 PM, Davoust, Pascal wrote:
 I'm using the tomcat jdbc connection pool (7.0.34) to connect
 against a PostgreSQL database (version 8.4 - jdbc driver 9.0.801)
 and I'm having a potentially dodgy situation with the validation
 mechanism.
 
 The code I'm using does change the transaction isolation level of
 a connection that has been newly borrowed from the pool (before
 doing anything else) but sometimes gets an error while doing so,
 such as:
 
 org.postgresql.util.PSQLException: Cannot change transaction
 isolation level in the middle of a transaction.
 
 I've been investigating the code for a while to check whether any 
 transaction was left open (read: without any commit or rollback)
 before being returned to the pool, but no chance, everything looks
 clean.

When returning a Connection to the pool, jdbc-pool should be following
the JDBC spec and committing any uncommitted transaction. The problem
is likely during/after check-out and not with a check-in. THere could
be bugs, of course.

 Then I suspected the validation mechanism which validates the
 connection. Mine was set to validate the connection every 30 s
 while idle, using a SELECT 1 statement.
 
 Indeed, I disabled the validation mechanism and tadaa, no error at
 all!

Good to know, but surprising.

 I then had a look at the corresponding code into the tomcat jdbc
 pool (source 7.0.34), and more specifically in class
 org.apache.tomcat.jdbc.pool.PooledConnection, method public
 boolean validate(int validateAction,String sql) at line 452
 (excerpt below):
 
 Statement stmt = null; try { stmt = connection.createStatement(); 
 stmt.execute(query); stmt.close(); this.lastValidated = now; return
 true; } catch (Exception ex) { if
 (getPoolProperties().getLogValidationErrors()) { log.warn(SQL
 Validation error, ex); } else if (log.isDebugEnabled()) { 
 log.debug(Unable to validate object:,ex); } if (stmt!=null) try {
 stmt.close();} catch (Exception ignore2){/*NOOP*/} } return false;

You (may) have a resource leak: you are not closing your statement in
the case of an exception. You need a 'finally' block.

http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/

 It looks to me that there is a mistake here: if the connection to
 validate does not have autoCommit set to true, then the transaction
 is started and left open by this code.

I would tend to agree. Can you check the status of
Connection.getAutoCommit after fetching a connection from the pool?

Also, is your altered transaction isolation level not appropriate for
all transactions?

 Which explains the errors I was experiencing, since once the
 connection has been validated, then the transaction isolation level
 cannot be changed since a transaction is still ongoing!
 
 Did I miss something or is this a real bug which I should file?

It may be a bug. Please create a minimal test case and attach it to a
bug report. Try to use the pool outside of Tomcat to simplify the
test-case even further.

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

iEYEAREIAAYFAlDnPOsACgkQ9CaO5/Lv0PBFDwCgmkKmjhadwgLBvZlZwuhTBFRR
gnkAoI3/FyDsXiqtFxWoZFcsV8KrZnfX
=wr5g
-END PGP SIGNATURE-

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



Re: [jdbc-pool] Transaction left open by the connection validation mechanism ?

2013-01-04 Thread Pid
On 04/01/2013 20:34, Christopher Schultz wrote:
 Pascal,
 
 On 1/3/13 12:49 PM, Davoust, Pascal wrote:
 I'm using the tomcat jdbc connection pool (7.0.34) to connect
 against a PostgreSQL database (version 8.4 - jdbc driver 9.0.801)
 and I'm having a potentially dodgy situation with the validation
 mechanism.
 
 The code I'm using does change the transaction isolation level of
 a connection that has been newly borrowed from the pool (before
 doing anything else) but sometimes gets an error while doing so,
 such as:
 
 org.postgresql.util.PSQLException: Cannot change transaction
 isolation level in the middle of a transaction.
 
 I've been investigating the code for a while to check whether any 
 transaction was left open (read: without any commit or rollback)
 before being returned to the pool, but no chance, everything looks
 clean.
 
 When returning a Connection to the pool, jdbc-pool should be following
 the JDBC spec and committing any uncommitted transaction. The problem
 is likely during/after check-out and not with a check-in. THere could
 be bugs, of course.
 
 Then I suspected the validation mechanism which validates the
 connection. Mine was set to validate the connection every 30 s
 while idle, using a SELECT 1 statement.
 
 Indeed, I disabled the validation mechanism and tadaa, no error at
 all!
 
 Good to know, but surprising.
 
 I then had a look at the corresponding code into the tomcat jdbc
 pool (source 7.0.34), and more specifically in class
 org.apache.tomcat.jdbc.pool.PooledConnection, method public
 boolean validate(int validateAction,String sql) at line 452
 (excerpt below):
 
 Statement stmt = null; try { stmt = connection.createStatement(); 
 stmt.execute(query); stmt.close(); this.lastValidated = now; return
 true; } catch (Exception ex) { if
 (getPoolProperties().getLogValidationErrors()) { log.warn(SQL
 Validation error, ex); } else if (log.isDebugEnabled()) { 
 log.debug(Unable to validate object:,ex); } if (stmt!=null) try {
 stmt.close();} catch (Exception ignore2){/*NOOP*/} } return false;
 
 You (may) have a resource leak: you are not closing your statement in
 the case of an exception. You need a 'finally' block.

I think Pascal is saying that the above snippet is in the Tomcat JDBC
code, not his.


p

 http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/
 
 It looks to me that there is a mistake here: if the connection to
 validate does not have autoCommit set to true, then the transaction
 is started and left open by this code.
 
 I would tend to agree. Can you check the status of
 Connection.getAutoCommit after fetching a connection from the pool?
 
 Also, is your altered transaction isolation level not appropriate for
 all transactions?
 
 Which explains the errors I was experiencing, since once the
 connection has been validated, then the transaction isolation level
 cannot be changed since a transaction is still ongoing!
 
 Did I miss something or is this a real bug which I should file?
 
 It may be a bug. Please create a minimal test case and attach it to a
 bug report. Try to use the pool outside of Tomcat to simplify the
 test-case even further.
 
 -chris
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: [jdbc-pool] Transaction left open by the connection validation mechanism ?

2013-01-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pid,

On 1/4/13 4:26 PM, Pid wrote:
 On 04/01/2013 20:34, Christopher Schultz wrote:
 On 1/3/13 12:49 PM, Davoust, Pascal wrote:
 
 I then had a look at the corresponding code into the tomcat
 jdbc pool (source 7.0.34), and more specifically in class 
 org.apache.tomcat.jdbc.pool.PooledConnection, method public 
 boolean validate(int validateAction,String sql) at line 452 
 (excerpt below):
 
 Statement stmt = null; try { stmt =
 connection.createStatement(); stmt.execute(query);
 stmt.close(); this.lastValidated = now; return true; } catch
 (Exception ex) { if 
 (getPoolProperties().getLogValidationErrors()) { log.warn(SQL 
 Validation error, ex); } else if (log.isDebugEnabled()) { 
 log.debug(Unable to validate object:,ex); } if (stmt!=null)
 try { stmt.close();} catch (Exception ignore2){/*NOOP*/} }
 return false;
 
 You (may) have a resource leak: you are not closing your
 statement in the case of an exception. You need a 'finally'
 block.
 
 I think Pascal is saying that the above snippet is in the Tomcat
 JDBC code, not his.

Whoops, I think you're right. That's a minor bug, but definitely one
that should be fixed IMO.

Also, if the validation query succeeds and the connection is in
auto-commit mode, we may want to issue a rollback. I wouldn't want to
do that without any additional configuration, though, because it would
needlessly send ROLLBACK queries in many cases (such as other
databases - MySQL doesn't get upset when I tried a simple, similar
test - or when you don't intend to change the transaction isolation
level, etc.).

Perhaps a configuration directive like rollBackAfterValidationQuery or
something?

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

iEYEAREIAAYFAlDnS80ACgkQ9CaO5/Lv0PCCYQCguRp0qAPS/ViLhUKGyV+Tc6mY
2qMAn3DpYdxDl5zo9EgLpqDSIFPmCDrD
=U427
-END PGP SIGNATURE-

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



Re: [jdbc-pool] Transaction left open by the connection validation mechanism ?

2013-01-04 Thread Davoust, Pascal
Indeed I was referring to the tomcat jdbc-pool code, not mine :-).

Now, I would suggest to consider that this problem is more common than you
could imagine at first sight. First because this is randomly occuring, but
frequently enough so that it shows up in quite a few areas.
A few examples where this problem occurred and was filed (but not analyzed
down to the root cause):

Spring DataSource Txn Mgr :
https://jira.springsource.org/browse/SPR-8870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

Hyperic :
https://jira.hyperic.com/browse/HHQ-5054

If I'm correct, then I suggest that the behavior is corrected by default,
not requiring additional configuration. Especially so that most people use
the provided sample and documentation, which enables the validation
mechanism. Or maybe do it the other way round, have a configuration key
which allows to disable the rollback after validation... One last way would
have been to test against the auto commit state of the connection to decide
whether a rollback was necessary, but I believe that the pool does not
maintain the connection state for performance reasons (unless an
interceptor is configured to do it) and therefore would be an even more
detrimental hit on performance since would require a round-trip to the db
server...

In any case, let me know if you need me to provide more details or to file
this problem into the bug tracking system!

Regards

Pascal

2013/1/4 Christopher Schultz ch...@christopherschultz.net

  I think Pascal is saying that the above snippet is in the Tomcat
  JDBC code, not his.

 Whoops, I think you're right. That's a minor bug, but definitely one
 that should be fixed IMO.

 Also, if the validation query succeeds and the connection is in
 auto-commit mode, we may want to issue a rollback. I wouldn't want to
 do that without any additional configuration, though, because it would
 needlessly send ROLLBACK queries in many cases (such as other
 databases - MySQL doesn't get upset when I tried a simple, similar
 test - or when you don't intend to change the transaction isolation
 level, etc.).

 Perhaps a configuration directive like rollBackAfterValidationQuery or
 something?

 - -chris



Re: [jdbc-pool] Transaction left open by the connection validation mechanism ?

2013-01-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Pascal,

On 1/4/13 5:56 PM, Davoust, Pascal wrote:
 Indeed I was referring to the tomcat jdbc-pool code, not mine :-).
 
 Now, I would suggest to consider that this problem is more common
 than you could imagine at first sight. First because this is
 randomly occuring, but frequently enough so that it shows up in
 quite a few areas. A few examples where this problem occurred and
 was filed (but not analyzed down to the root cause):
 
 Spring DataSource Txn Mgr : 
 https://jira.springsource.org/browse/SPR-8870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel

  Hyperic : https://jira.hyperic.com/browse/HHQ-5054
 
 If I'm correct, then I suggest that the behavior is corrected by
 default, not requiring additional configuration.

I disagree: issuing a ROLLBACK on every connection-checkout seems
heavy-handed if it's not necessary. You are talking about a fairly
rare set of circumstances (e.g. changing tx isolation level for only
some uses of the connection-pool) and punishing everyone (performance)
for that circumstance is IMHO unnecessary.

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

iEYEAREIAAYFAlDnY5oACgkQ9CaO5/Lv0PARVgCgvPLCsydboLrgcLiQUg9wD/zI
g/MAn0ZakKw6QgXd7n47UZ3CRtaYrRex
=j8ND
-END PGP SIGNATURE-

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



Re: [jdbc-pool] Transaction left open by the connection validation mechanism ?

2013-01-04 Thread Davoust, Pascal
Sorry, I probably did not make myself clear.

I certainly do not suggest to issue the rollback on each connection
checkout, but only as part of the validation process - because this is
where the problem lies and only there - which I would imagine is triggered
only occasionally (when connection is idle for example): I doubt someone
would actually validate connections each time it's checked or out in. But I
might be wrong.

In any case, I suppose that the pool must not hand over a connection at
check-out time with an open transaction triggered by the internal
validation mechanism of the pool - irrespective of what you do with the
connection.

Am I wrong?

Regards
Le 5 janv. 2013 00:20, Christopher Schultz ch...@christopherschultz.net
a écrit :

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Pascal,

 On 1/4/13 5:56 PM, Davoust, Pascal wrote:
  Indeed I was referring to the tomcat jdbc-pool code, not mine :-).
 
  Now, I would suggest to consider that this problem is more common
  than you could imagine at first sight. First because this is
  randomly occuring, but frequently enough so that it shows up in
  quite a few areas. A few examples where this problem occurred and
  was filed (but not analyzed down to the root cause):
 
  Spring DataSource Txn Mgr :
 
 https://jira.springsource.org/browse/SPR-8870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
 
   Hyperic : https://jira.hyperic.com/browse/HHQ-5054
 
  If I'm correct, then I suggest that the behavior is corrected by
  default, not requiring additional configuration.

 I disagree: issuing a ROLLBACK on every connection-checkout seems
 heavy-handed if it's not necessary. You are talking about a fairly
 rare set of circumstances (e.g. changing tx isolation level for only
 some uses of the connection-pool) and punishing everyone (performance)
 for that circumstance is IMHO unnecessary.

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

 iEYEAREIAAYFAlDnY5oACgkQ9CaO5/Lv0PARVgCgvPLCsydboLrgcLiQUg9wD/zI
 g/MAn0ZakKw6QgXd7n47UZ3CRtaYrRex
 =j8ND
 -END PGP SIGNATURE-

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




Re: jdbc connection debugging, tips?

2012-11-13 Thread Daniel Mikusa
On Nov 12, 2012, at 10:55 PM, S Ahmed wrote:

 I can't seem to connect to my mysql database from my java code, but I can
 do it via terminal using the user and password that is in my spring context
 file.
 
 I also tried modifying it to localhost:3306 but that didn't change anything
 (it defaults to 3306).

Have you tried using 127.0.0.1 or the IP address of the machine?  Perhaps 
something is not right in your /etc/hosts file and it is unable to lookup 
localhost.

 
 Both the application and mysql are on the same server (ec2).
 
 What can I do to figure out the issue?  I'm lost!
 
 my xml file has:
 
bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
 destroy-method=close
property name=driverClassName value=com.mysql.jdbc.Driver/
property name=url value=jdbc:mysql://localhost/mydb/
property name=username value=myuser/
property name=password value=123/
 
property name=maxActive value=100/
property name=maxIdle value=30/
property name=maxWait value=1000/
property name=defaultAutoCommit value=true/
property name=removeAbandoned value=true/
property name=removeAbandonedTimeout value=60/
 
property name=testOnBorrow value=true/
property name=validationQuery value=SELECT 1/
 
/bean
 
 This is the error I am getting:
 
 Exception in thread main
 org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
 JDBC Connection; nested exception is
 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
 link failure
 
snip
 
 Caused by: java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
 at
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
 at
 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
 at java.net.Socket.connect(Socket.java:546)
 at java.net.Socket.connect(Socket.java:495)
 at java.net.Socket.init(Socket.java:392)
 at java.net.Socket.init(Socket.java:235)
 at
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
 at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:300)
 ... 29 more

Seems like the root cause is that a connection cannot be made to the server.  
Double check your credentials.  Also, how are you testing from the terminal?  
Can you run telnet localhost 3306?

Dan



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



Re: jdbc connection debugging, tips?

2012-11-13 Thread S Ahmed
Dan,

Thanks for your help.

From the terminal I was very explicit, I did this:

mysql --host localhost --port 3306 --user myuser --password
password: 123

And it worked fine.  In my log4net, I believe I set jdbc logs to be ALL or
DEBUG (i'll check when I get home), but it didn't output the host and
password (just in case it is reading from the wrong file somehow??).




On Tue, Nov 13, 2012 at 8:18 AM, Daniel Mikusa dmik...@vmware.com wrote:

 On Nov 12, 2012, at 10:55 PM, S Ahmed wrote:

  I can't seem to connect to my mysql database from my java code, but I can
  do it via terminal using the user and password that is in my spring
 context
  file.
 
  I also tried modifying it to localhost:3306 but that didn't change
 anything
  (it defaults to 3306).

 Have you tried using 127.0.0.1 or the IP address of the machine?  Perhaps
 something is not right in your /etc/hosts file and it is unable to lookup
 localhost.

 
  Both the application and mysql are on the same server (ec2).
 
  What can I do to figure out the issue?  I'm lost!
 
  my xml file has:
 
 bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
  destroy-method=close
 property name=driverClassName value=com.mysql.jdbc.Driver/
 property name=url value=jdbc:mysql://localhost/mydb/
 property name=username value=myuser/
 property name=password value=123/
 
 property name=maxActive value=100/
 property name=maxIdle value=30/
 property name=maxWait value=1000/
 property name=defaultAutoCommit value=true/
 property name=removeAbandoned value=true/
 property name=removeAbandonedTimeout value=60/
 
 property name=testOnBorrow value=true/
 property name=validationQuery value=SELECT 1/
 
 /bean
 
  This is the error I am getting:
 
  Exception in thread main
  org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
  JDBC Connection; nested exception is
  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
  link failure
 
 snip
 
  Caused by: java.net.ConnectException: Connection refused
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at
 
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
  at
 
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
  at
 
 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
  at java.net.Socket.connect(Socket.java:546)
  at java.net.Socket.connect(Socket.java:495)
  at java.net.Socket.init(Socket.java:392)
  at java.net.Socket.init(Socket.java:235)
  at
 
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
  at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:300)
  ... 29 more

 Seems like the root cause is that a connection cannot be made to the
 server.  Double check your credentials.  Also, how are you testing from the
 terminal?  Can you run telnet localhost 3306?

 Dan



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




Re: jdbc connection debugging, tips?

2012-11-13 Thread Daniel Mikusa
On Nov 13, 2012, at 9:55 AM, S Ahmed wrote:

 Dan,
 
 Thanks for your help.
 
 From the terminal I was very explicit, I did this:
 
 mysql --host localhost --port 3306 --user myuser --password
 password: 123
 
 And it worked fine.  In my log4net, I believe I set jdbc logs to be ALL or
 DEBUG (i'll check when I get home), but it didn't output the host and
 password (just in case it is reading from the wrong file somehow??).

It's not an issue of a wrong user / pass, the exception is saying that it 
literally cannot connect to the host that you've specified.

 Caused by: java.net.ConnectException: Connection refused

Can you include the output from the following commands?

telnet localhost 3306
telnet 127.0.0.1 3306
cat /etc/hosts

You might also want to enable wireshark and see what is happening when your 
application starts.

Dan



 
 
 
 On Tue, Nov 13, 2012 at 8:18 AM, Daniel Mikusa dmik...@vmware.com wrote:
 
 On Nov 12, 2012, at 10:55 PM, S Ahmed wrote:
 
 I can't seem to connect to my mysql database from my java code, but I can
 do it via terminal using the user and password that is in my spring
 context
 file.
 
 I also tried modifying it to localhost:3306 but that didn't change
 anything
 (it defaults to 3306).
 
 Have you tried using 127.0.0.1 or the IP address of the machine?  Perhaps
 something is not right in your /etc/hosts file and it is unable to lookup
 localhost.
 
 
 Both the application and mysql are on the same server (ec2).
 
 What can I do to figure out the issue?  I'm lost!
 
 my xml file has:
 
   bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
 destroy-method=close
   property name=driverClassName value=com.mysql.jdbc.Driver/
   property name=url value=jdbc:mysql://localhost/mydb/
   property name=username value=myuser/
   property name=password value=123/
 
   property name=maxActive value=100/
   property name=maxIdle value=30/
   property name=maxWait value=1000/
   property name=defaultAutoCommit value=true/
   property name=removeAbandoned value=true/
   property name=removeAbandonedTimeout value=60/
 
   property name=testOnBorrow value=true/
   property name=validationQuery value=SELECT 1/
 
   /bean
 
 This is the error I am getting:
 
 Exception in thread main
 org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
 JDBC Connection; nested exception is
 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
 link failure
 
 snip
 
 Caused by: java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at
 
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
 at
 
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
 at
 
 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
 at java.net.Socket.connect(Socket.java:546)
 at java.net.Socket.connect(Socket.java:495)
 at java.net.Socket.init(Socket.java:392)
 at java.net.Socket.init(Socket.java:235)
 at
 
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
 at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:300)
 ... 29 more
 
 Seems like the root cause is that a connection cannot be made to the
 server.  Double check your credentials.  Also, how are you testing from the
 terminal?  Can you run telnet localhost 3306?
 
 Dan
 
 
 
 -
 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: jdbc connection debugging, tips?

2012-11-13 Thread S Ahmed
I'll report back tonight, thanks again!


On Tue, Nov 13, 2012 at 11:08 AM, Daniel Mikusa dmik...@vmware.com wrote:

 On Nov 13, 2012, at 9:55 AM, S Ahmed wrote:

  Dan,
 
  Thanks for your help.
 
  From the terminal I was very explicit, I did this:
 
  mysql --host localhost --port 3306 --user myuser --password
  password: 123
 
  And it worked fine.  In my log4net, I believe I set jdbc logs to be ALL
 or
  DEBUG (i'll check when I get home), but it didn't output the host and
  password (just in case it is reading from the wrong file somehow??).

 It's not an issue of a wrong user / pass, the exception is saying that it
 literally cannot connect to the host that you've specified.

  Caused by: java.net.ConnectException: Connection refused

 Can you include the output from the following commands?

 telnet localhost 3306
 telnet 127.0.0.1 3306
 cat /etc/hosts

 You might also want to enable wireshark and see what is happening when
 your application starts.

 Dan



 
 
 
  On Tue, Nov 13, 2012 at 8:18 AM, Daniel Mikusa dmik...@vmware.com
 wrote:
 
  On Nov 12, 2012, at 10:55 PM, S Ahmed wrote:
 
  I can't seem to connect to my mysql database from my java code, but I
 can
  do it via terminal using the user and password that is in my spring
  context
  file.
 
  I also tried modifying it to localhost:3306 but that didn't change
  anything
  (it defaults to 3306).
 
  Have you tried using 127.0.0.1 or the IP address of the machine?
  Perhaps
  something is not right in your /etc/hosts file and it is unable to
 lookup
  localhost.
 
 
  Both the application and mysql are on the same server (ec2).
 
  What can I do to figure out the issue?  I'm lost!
 
  my xml file has:
 
bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
  destroy-method=close
property name=driverClassName value=com.mysql.jdbc.Driver/
property name=url value=jdbc:mysql://localhost/mydb/
property name=username value=myuser/
property name=password value=123/
 
property name=maxActive value=100/
property name=maxIdle value=30/
property name=maxWait value=1000/
property name=defaultAutoCommit value=true/
property name=removeAbandoned value=true/
property name=removeAbandonedTimeout value=60/
 
property name=testOnBorrow value=true/
property name=validationQuery value=SELECT 1/
 
/bean
 
  This is the error I am getting:
 
  Exception in thread main
  org.springframework.jdbc.CannotGetJdbcConnectionException: Could not
 get
  JDBC Connection; nested exception is
  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
  link failure
 
  snip
 
  Caused by: java.net.ConnectException: Connection refused
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at
 
 
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
  at
 
 
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
  at
 
 
 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
  at java.net.Socket.connect(Socket.java:546)
  at java.net.Socket.connect(Socket.java:495)
  at java.net.Socket.init(Socket.java:392)
  at java.net.Socket.init(Socket.java:235)
  at
 
 
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
  at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:300)
  ... 29 more
 
  Seems like the root cause is that a connection cannot be made to the
  server.  Double check your credentials.  Also, how are you testing from
 the
  terminal?  Can you run telnet localhost 3306?
 
  Dan
 
 
 
  -
  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: jdbc connection debugging, tips?

2012-11-13 Thread S Ahmed
ubuntu:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 5.1.63-0ubuntu0.11.04.1-log (Ubuntu)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.

mysql exit
Bye
ubuntu:~$ telnet localhost 3306
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
ubuntu:~$ telnet 127.0.0.1 3306
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
ubuntu:~$ cat /etc/hosts
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
ubuntu:~$

ubuntu:~$ cat /etc/issue
Ubuntu 11.04 \n \l





On Tue, Nov 13, 2012 at 11:16 AM, S Ahmed sahmed1...@gmail.com wrote:

 I'll report back tonight, thanks again!


 On Tue, Nov 13, 2012 at 11:08 AM, Daniel Mikusa dmik...@vmware.comwrote:

 On Nov 13, 2012, at 9:55 AM, S Ahmed wrote:

  Dan,
 
  Thanks for your help.
 
  From the terminal I was very explicit, I did this:
 
  mysql --host localhost --port 3306 --user myuser --password
  password: 123
 
  And it worked fine.  In my log4net, I believe I set jdbc logs to be ALL
 or
  DEBUG (i'll check when I get home), but it didn't output the host and
  password (just in case it is reading from the wrong file somehow??).

 It's not an issue of a wrong user / pass, the exception is saying that it
 literally cannot connect to the host that you've specified.

  Caused by: java.net.ConnectException: Connection refused

 Can you include the output from the following commands?

 telnet localhost 3306
 telnet 127.0.0.1 3306
 cat /etc/hosts

 You might also want to enable wireshark and see what is happening when
 your application starts.

 Dan



 
 
 
  On Tue, Nov 13, 2012 at 8:18 AM, Daniel Mikusa dmik...@vmware.com
 wrote:
 
  On Nov 12, 2012, at 10:55 PM, S Ahmed wrote:
 
  I can't seem to connect to my mysql database from my java code, but I
 can
  do it via terminal using the user and password that is in my spring
  context
  file.
 
  I also tried modifying it to localhost:3306 but that didn't change
  anything
  (it defaults to 3306).
 
  Have you tried using 127.0.0.1 or the IP address of the machine?
  Perhaps
  something is not right in your /etc/hosts file and it is unable to
 lookup
  localhost.
 
 
  Both the application and mysql are on the same server (ec2).
 
  What can I do to figure out the issue?  I'm lost!
 
  my xml file has:
 
bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
  destroy-method=close
property name=driverClassName value=com.mysql.jdbc.Driver/
property name=url value=jdbc:mysql://localhost/mydb/
property name=username value=myuser/
property name=password value=123/
 
property name=maxActive value=100/
property name=maxIdle value=30/
property name=maxWait value=1000/
property name=defaultAutoCommit value=true/
property name=removeAbandoned value=true/
property name=removeAbandonedTimeout value=60/
 
property name=testOnBorrow value=true/
property name=validationQuery value=SELECT 1/
 
/bean
 
  This is the error I am getting:
 
  Exception in thread main
  org.springframework.jdbc.CannotGetJdbcConnectionException: Could not
 get
  JDBC Connection; nested exception is
  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
 Communications
  link failure
 
  snip
 
  Caused by: java.net.ConnectException: Connection refused
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at
 
 
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
  at
 
 
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
  at
 
 
 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
  at java.net.Socket.connect(Socket.java:546)
  at java.net.Socket.connect(Socket.java:495)
  at java.net.Socket.init(Socket.java:392)
  at java.net.Socket.init(Socket.java:235)
  at
 
 
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
  at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:300)
  ... 29 more
 
  Seems like the root cause is that a connection cannot be made to the
  server.  Double check your credentials.  Also, how are you testing
 from the
  terminal?  Can you run telnet localhost 3306?
 
  Dan
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


 

Re: jdbc connection debugging, tips?

2012-11-13 Thread S Ahmed
Ok it turns out it was bound to an private ip address on ec2, thanks Dan!


On Tue, Nov 13, 2012 at 10:52 PM, S Ahmed sahmed1...@gmail.com wrote:

 ubuntu:~$ mysql -u root -p
 Enter password:
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 58
 Server version: 5.1.63-0ubuntu0.11.04.1-log (Ubuntu)

 Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights
 reserved.

 Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.

 Type 'help;' or '\h' for help. Type '\c' to clear the current input
 statement.

 mysql exit
 Bye
 ubuntu:~$ telnet localhost 3306
 Trying 127.0.0.1...
 telnet: Unable to connect to remote host: Connection refused
 ubuntu:~$ telnet 127.0.0.1 3306
 Trying 127.0.0.1...
 telnet: Unable to connect to remote host: Connection refused
 ubuntu:~$ cat /etc/hosts
 127.0.0.1 localhost

 # The following lines are desirable for IPv6 capable hosts
 ::1 ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters
 ff02::3 ip6-allhosts
 ubuntu:~$

 ubuntu:~$ cat /etc/issue
 Ubuntu 11.04 \n \l





 On Tue, Nov 13, 2012 at 11:16 AM, S Ahmed sahmed1...@gmail.com wrote:

 I'll report back tonight, thanks again!


 On Tue, Nov 13, 2012 at 11:08 AM, Daniel Mikusa dmik...@vmware.comwrote:

 On Nov 13, 2012, at 9:55 AM, S Ahmed wrote:

  Dan,
 
  Thanks for your help.
 
  From the terminal I was very explicit, I did this:
 
  mysql --host localhost --port 3306 --user myuser --password
  password: 123
 
  And it worked fine.  In my log4net, I believe I set jdbc logs to be
 ALL or
  DEBUG (i'll check when I get home), but it didn't output the host and
  password (just in case it is reading from the wrong file somehow??).

 It's not an issue of a wrong user / pass, the exception is saying that
 it literally cannot connect to the host that you've specified.

  Caused by: java.net.ConnectException: Connection refused

 Can you include the output from the following commands?

 telnet localhost 3306
 telnet 127.0.0.1 3306
 cat /etc/hosts

 You might also want to enable wireshark and see what is happening when
 your application starts.

 Dan



 
 
 
  On Tue, Nov 13, 2012 at 8:18 AM, Daniel Mikusa dmik...@vmware.com
 wrote:
 
  On Nov 12, 2012, at 10:55 PM, S Ahmed wrote:
 
  I can't seem to connect to my mysql database from my java code, but
 I can
  do it via terminal using the user and password that is in my spring
  context
  file.
 
  I also tried modifying it to localhost:3306 but that didn't change
  anything
  (it defaults to 3306).
 
  Have you tried using 127.0.0.1 or the IP address of the machine?
  Perhaps
  something is not right in your /etc/hosts file and it is unable to
 lookup
  localhost.
 
 
  Both the application and mysql are on the same server (ec2).
 
  What can I do to figure out the issue?  I'm lost!
 
  my xml file has:
 
bean id=dataSource
 class=org.apache.tomcat.jdbc.pool.DataSource
  destroy-method=close
property name=driverClassName
 value=com.mysql.jdbc.Driver/
property name=url value=jdbc:mysql://localhost/mydb/
property name=username value=myuser/
property name=password value=123/
 
property name=maxActive value=100/
property name=maxIdle value=30/
property name=maxWait value=1000/
property name=defaultAutoCommit value=true/
property name=removeAbandoned value=true/
property name=removeAbandonedTimeout value=60/
 
property name=testOnBorrow value=true/
property name=validationQuery value=SELECT 1/
 
/bean
 
  This is the error I am getting:
 
  Exception in thread main
  org.springframework.jdbc.CannotGetJdbcConnectionException: Could not
 get
  JDBC Connection; nested exception is
  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
 Communications
  link failure
 
  snip
 
  Caused by: java.net.ConnectException: Connection refused
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at
 
 
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
  at
 
 
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
  at
 
 
 java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
  at java.net.Socket.connect(Socket.java:546)
  at java.net.Socket.connect(Socket.java:495)
  at java.net.Socket.init(Socket.java:392)
  at java.net.Socket.init(Socket.java:235)
  at
 
 
 com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
  at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:300)
  ... 29 more
 
  Seems like the root cause is that a connection cannot be made to the
  server.  Double check your credentials.  Also, how are you testing
 from the
  terminal?  Can you run telnet localhost 3306?
 
  Dan
 
 
 
  

Re: jdbc connection debugging, tips?

2012-11-12 Thread S Ahmed
This same setup works fine locally on my laptop..so it does work :)


On Mon, Nov 12, 2012 at 10:55 PM, S Ahmed sahmed1...@gmail.com wrote:

 I can't seem to connect to my mysql database from my java code, but I can
 do it via terminal using the user and password that is in my spring context
 file.

 I also tried modifying it to localhost:3306 but that didn't change
 anything (it defaults to 3306).

 Both the application and mysql are on the same server (ec2).

 What can I do to figure out the issue?  I'm lost!

 my xml file has:

 bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
 destroy-method=close
 property name=driverClassName value=com.mysql.jdbc.Driver/
 property name=url value=jdbc:mysql://localhost/mydb/
 property name=username value=myuser/
 property name=password value=123/

 property name=maxActive value=100/
 property name=maxIdle value=30/
 property name=maxWait value=1000/
 property name=defaultAutoCommit value=true/
 property name=removeAbandoned value=true/
 property name=removeAbandonedTimeout value=60/

 property name=testOnBorrow value=true/
 property name=validationQuery value=SELECT 1/

 /bean

 This is the error I am getting:

 Exception in thread main
 org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get
 JDBC Connection; nested exception is
 com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
 link failure

 The last packet sent successfully to the server was 0 milliseconds ago.
 The driver has not received any packets from the server.
 at
 org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
  at
 org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:382)
 at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:456)
  at
 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:464)
 at A.data.jdbc.PlanTypeDaoImpl.findAllActive(PlanTypeDaoImpl.java:23)
  at
 com.just.testing.services.PlanTypeServiceImpl.getPlanTypesMap(PlanTypeServiceImpl.java:33)
 at com.just.testing.http.HttpErrorServer.main(HttpErrorServer.java:36)
 Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
 Communications link failure

 The last packet sent successfully to the server was 0 milliseconds ago.
 The driver has not received any packets from the server.
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
 at
 com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
  at com.mysql.jdbc.MysqlIO.init(MysqlIO.java:350)
 at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2393)
  at
 com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430)
 at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
  at com.mysql.jdbc.ConnectionImpl.init(ConnectionImpl.java:813)
 at com.mysql.jdbc.JDBC4Connection.init(JDBC4Connection.java:47)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
  at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
 at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
  at
 com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
 at
 org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:277)
  at
 org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
 at
 org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
  at
 org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:631)
 at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:485)
  at
 org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:143)
 at
 org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
  at
 org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
 at
 org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
  at
 org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
 at
 org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
  ... 6 more
 Caused by: java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)

RE: JDBC Connection over VPN

2012-05-07 Thread Propes, Barry L
Could the VPN connection be utlizing the same port Tomcat or Oracle usually 
does? Like something at 8080?

Not sure if that's the case; or conversely, does going into VPN block those 
ports?


-Original Message-
From: Sanjeev Sharma [mailto:sanjeev.sha...@buchanan-edwards.com]
Sent: Monday, May 07, 2012 2:36 PM
To: Tomcat Users List
Subject: JDBC Connection over VPN

Hi,

Not sure if this is a Tomcat issue.  When I connect directly to a network and 
startup my tomcat 7, my JDBC connection to an Oracle 11g network works just 
fine, but if I tunnel into the same network, JDBC fails to connect to the 
database.  At the same time I'm able to make a connection to the same database 
using SQL Developer/SQL Plus.  My network people tell me that all ports are 
open to me and when they try to capture packets coming from me, they see 
nothing if I'm starting up my tomcat.  I'm not a Network or VPN expert, but as 
far as I know, at the application level it should behave just as if I'm 
connected directly to the network and shouldn't have to worry about which 
network adapter to use (built in or VPN), and shouldn't have to worry about 
routing.  I'm at a complete loss, so I'm just hoping there is magical tomcat 
setting which will fix my problem.  Any help would be appreciated .

Thanks.

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



RE: JDBC Connection over VPN

2012-05-07 Thread Sanjeev Sharma
Using port 1521 in both cases, but it only fails for JDBC.

-Original Message-
From: Propes, Barry L [mailto:barry.l.pro...@citi.com] 
Sent: Monday, May 07, 2012 3:43 PM
To: 'Tomcat Users List'
Subject: RE: JDBC Connection over VPN

Could the VPN connection be utlizing the same port Tomcat or Oracle usually 
does? Like something at 8080?

Not sure if that's the case; or conversely, does going into VPN block those 
ports?


-Original Message-
From: Sanjeev Sharma [mailto:sanjeev.sha...@buchanan-edwards.com]
Sent: Monday, May 07, 2012 2:36 PM
To: Tomcat Users List
Subject: JDBC Connection over VPN

Hi,

Not sure if this is a Tomcat issue.  When I connect directly to a network and 
startup my tomcat 7, my JDBC connection to an Oracle 11g network works just 
fine, but if I tunnel into the same network, JDBC fails to connect to the 
database.  At the same time I'm able to make a connection to the same database 
using SQL Developer/SQL Plus.  My network people tell me that all ports are 
open to me and when they try to capture packets coming from me, they see 
nothing if I'm starting up my tomcat.  I'm not a Network or VPN expert, but as 
far as I know, at the application level it should behave just as if I'm 
connected directly to the network and shouldn't have to worry about which 
network adapter to use (built in or VPN), and shouldn't have to worry about 
routing.  I'm at a complete loss, so I'm just hoping there is magical tomcat 
setting which will fix my problem.  Any help would be appreciated .

Thanks.

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




Re: JDBC Connection over VPN

2012-05-07 Thread Saurabh Makol
Can you run

telnet DatahbaseIpaddress 1521 from command prompt when you VPN into your
network?

On Mon, May 7, 2012 at 3:46 PM, Sanjeev Sharma 
sanjeev.sha...@buchanan-edwards.com wrote:

 Using port 1521 in both cases, but it only fails for JDBC.

 -Original Message-
 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Sent: Monday, May 07, 2012 3:43 PM
 To: 'Tomcat Users List'
 Subject: RE: JDBC Connection over VPN

 Could the VPN connection be utlizing the same port Tomcat or Oracle
 usually does? Like something at 8080?

 Not sure if that's the case; or conversely, does going into VPN block
 those ports?


 -Original Message-
 From: Sanjeev Sharma [mailto:sanjeev.sha...@buchanan-edwards.com]
 Sent: Monday, May 07, 2012 2:36 PM
 To: Tomcat Users List
 Subject: JDBC Connection over VPN

 Hi,

 Not sure if this is a Tomcat issue.  When I connect directly to a network
 and startup my tomcat 7, my JDBC connection to an Oracle 11g network works
 just fine, but if I tunnel into the same network, JDBC fails to connect to
 the database.  At the same time I'm able to make a connection to the same
 database using SQL Developer/SQL Plus.  My network people tell me that all
 ports are open to me and when they try to capture packets coming from me,
 they see nothing if I'm starting up my tomcat.  I'm not a Network or VPN
 expert, but as far as I know, at the application level it should behave
 just as if I'm connected directly to the network and shouldn't have to
 worry about which network adapter to use (built in or VPN), and shouldn't
 have to worry about routing.  I'm at a complete loss, so I'm just hoping
 there is magical tomcat setting which will fix my problem.  Any help would
 be appreciated .

 Thanks.

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





RE: JDBC Connection over VPN

2012-05-07 Thread Sanjeev Sharma
Telnet seems to connect.

-Original Message-
From: Saurabh Makol [mailto:saurabh.ma...@gmail.com] 
Sent: Monday, May 07, 2012 3:50 PM
To: Tomcat Users List
Subject: Re: JDBC Connection over VPN

Can you run

telnet DatahbaseIpaddress 1521 from command prompt when you VPN into your 
network?

On Mon, May 7, 2012 at 3:46 PM, Sanjeev Sharma  
sanjeev.sha...@buchanan-edwards.com wrote:

 Using port 1521 in both cases, but it only fails for JDBC.

 -Original Message-
 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Sent: Monday, May 07, 2012 3:43 PM
 To: 'Tomcat Users List'
 Subject: RE: JDBC Connection over VPN

 Could the VPN connection be utlizing the same port Tomcat or Oracle 
 usually does? Like something at 8080?

 Not sure if that's the case; or conversely, does going into VPN block 
 those ports?


 -Original Message-
 From: Sanjeev Sharma [mailto:sanjeev.sha...@buchanan-edwards.com]
 Sent: Monday, May 07, 2012 2:36 PM
 To: Tomcat Users List
 Subject: JDBC Connection over VPN

 Hi,

 Not sure if this is a Tomcat issue.  When I connect directly to a 
 network and startup my tomcat 7, my JDBC connection to an Oracle 11g 
 network works just fine, but if I tunnel into the same network, JDBC 
 fails to connect to the database.  At the same time I'm able to make a 
 connection to the same database using SQL Developer/SQL Plus.  My 
 network people tell me that all ports are open to me and when they try 
 to capture packets coming from me, they see nothing if I'm starting up 
 my tomcat.  I'm not a Network or VPN expert, but as far as I know, at 
 the application level it should behave just as if I'm connected 
 directly to the network and shouldn't have to worry about which 
 network adapter to use (built in or VPN), and shouldn't have to worry 
 about routing.  I'm at a complete loss, so I'm just hoping there is 
 magical tomcat setting which will fix my problem.  Any help would be 
 appreciated .

 Thanks.

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





RE: JDBC Connection over VPN

2012-05-07 Thread Sanjeev Sharma
Found a solutions for this.  Apparently Java 7 wraps IPV4 addresses as IPV6, 
which is not supported by Cisco Anyconnect.  Turning of IPV6 on the Cisco VPN 
adapter (Control Panel\Network and Internet\Network Connections) fixed the 
problem.

-Original Message-
From: Sanjeev Sharma [mailto:sanjeev.sha...@buchanan-edwards.com] 
Sent: Monday, May 07, 2012 4:04 PM
To: Tomcat Users List
Subject: RE: JDBC Connection over VPN

Telnet seems to connect.

-Original Message-
From: Saurabh Makol [mailto:saurabh.ma...@gmail.com]
Sent: Monday, May 07, 2012 3:50 PM
To: Tomcat Users List
Subject: Re: JDBC Connection over VPN

Can you run

telnet DatahbaseIpaddress 1521 from command prompt when you VPN into your 
network?

On Mon, May 7, 2012 at 3:46 PM, Sanjeev Sharma  
sanjeev.sha...@buchanan-edwards.com wrote:

 Using port 1521 in both cases, but it only fails for JDBC.

 -Original Message-
 From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
 Sent: Monday, May 07, 2012 3:43 PM
 To: 'Tomcat Users List'
 Subject: RE: JDBC Connection over VPN

 Could the VPN connection be utlizing the same port Tomcat or Oracle 
 usually does? Like something at 8080?

 Not sure if that's the case; or conversely, does going into VPN block 
 those ports?


 -Original Message-
 From: Sanjeev Sharma [mailto:sanjeev.sha...@buchanan-edwards.com]
 Sent: Monday, May 07, 2012 2:36 PM
 To: Tomcat Users List
 Subject: JDBC Connection over VPN

 Hi,

 Not sure if this is a Tomcat issue.  When I connect directly to a 
 network and startup my tomcat 7, my JDBC connection to an Oracle 11g 
 network works just fine, but if I tunnel into the same network, JDBC 
 fails to connect to the database.  At the same time I'm able to make a 
 connection to the same database using SQL Developer/SQL Plus.  My 
 network people tell me that all ports are open to me and when they try 
 to capture packets coming from me, they see nothing if I'm starting up 
 my tomcat.  I'm not a Network or VPN expert, but as far as I know, at 
 the application level it should behave just as if I'm connected 
 directly to the network and shouldn't have to worry about which 
 network adapter to use (built in or VPN), and shouldn't have to worry 
 about routing.  I'm at a complete loss, so I'm just hoping there is 
 magical tomcat setting which will fix my problem.  Any help would be 
 appreciated .

 Thanks.

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



B?CB??[??XX?KK[XZ[
?\?\??][??XX?P?X?]
?\X?KBY][??[??[X[??K[XZ[
?\?\??Z[?X?]
?\X?KB?


Re: jdbc pool properties

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

Daniel,

On 4/4/12 8:46 AM, Daniel Mikusa wrote:
 - Original Message -
 My db connections seem to be lost after an extended period of 
 inactivity (for a web application). And the only way to get the 
 connections to work again is to restart tomcat.
 
 My tomcat.jdbc.pool.Datasource settings have:
 
 property name=maxActive value=100/ property name=maxIdle
 value=30/ property name=maxWait value=1000/ property
 name=defaultAutoCommit value=true/ property
 name=removeAbandoned value=true/ property
 name=removeAbandonedTimeout value=60/
 
 You probably want to add testOnBorrow=true and 
 validationQuery=SELECT 1  (or some other valid query for your
 DB).

+1

 See the following link for an explanation of those properties.
 
 https://commons.apache.org/dbcp/configuration.html

- -1

This is the wrong documentation for tomcat-pool. You're looking for
http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

On the other hand, there was no mention of a Tomcat version, what type
of pool is actually being used (I inferred tomcat-pool from the
subject line as well as the use of tomcat.jdbc.pool.DataSource) and
the use of property elements seems antiquated, so I must admit I'm a
little confused.

- -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/

iEYEARECAAYFAk9/MWAACgkQ9CaO5/Lv0PCcOgCeJcRA6Oq2KcVSDE6vIAmQ+5Ji
lJUAoL4QiLp1oZSBVkiaFYTrJTlK6Gkv
=wFzD
-END PGP SIGNATURE-

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



Re: jdbc pool properties

2012-04-06 Thread S Ahmed
I'm using tomcat 7, in a spring mvc application.  The properties is in my
spring-context.xml file.

 bean id=dataSource class=org.apache.tomcat.jdbc.pool.DataSource
destroy-method=close
property name=driverClassName value=com.mysql.jdbc.Driver/
property name=url value=jdbc:mysql://localhost/mydb/
property name=username value=testuser/
property name=password value=abc/

property name=maxActive value=100/
property name=maxIdle value=30/
property name=maxWait value=1000/
property name=defaultAutoCommit value=true/
property name=removeAbandoned value=true/
property name=removeAbandonedTimeout value=60/

property name=testOnBorrow value=true /
property name=validationQuery value=SELECT 1 /

/bean

On Fri, Apr 6, 2012 at 2:09 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Daniel,

 On 4/4/12 8:46 AM, Daniel Mikusa wrote:
  - Original Message -
  My db connections seem to be lost after an extended period of
  inactivity (for a web application). And the only way to get the
  connections to work again is to restart tomcat.
 
  My tomcat.jdbc.pool.Datasource settings have:
 
  property name=maxActive value=100/ property name=maxIdle
  value=30/ property name=maxWait value=1000/ property
  name=defaultAutoCommit value=true/ property
  name=removeAbandoned value=true/ property
  name=removeAbandonedTimeout value=60/
 
  You probably want to add testOnBorrow=true and
  validationQuery=SELECT 1  (or some other valid query for your
  DB).

 +1

  See the following link for an explanation of those properties.
 
  https://commons.apache.org/dbcp/configuration.html

 - -1

 This is the wrong documentation for tomcat-pool. You're looking for
 http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

 On the other hand, there was no mention of a Tomcat version, what type
 of pool is actually being used (I inferred tomcat-pool from the
 subject line as well as the use of tomcat.jdbc.pool.DataSource) and
 the use of property elements seems antiquated, so I must admit I'm a
 little confused.

 - -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/

 iEYEARECAAYFAk9/MWAACgkQ9CaO5/Lv0PCcOgCeJcRA6Oq2KcVSDE6vIAmQ+5Ji
 lJUAoL4QiLp1oZSBVkiaFYTrJTlK6Gkv
 =wFzD
 -END PGP SIGNATURE-

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




Re: jdbc pool properties

2012-04-05 Thread S Ahmed
Daniel,

Your suggestion seems to have worked so far, thanks!

testOnBorrow=true and validationQuery=SELECT 1

On Wed, Apr 4, 2012 at 8:46 AM, Daniel Mikusa dmik...@vmware.com wrote:



 - Original Message -
  My db connections seem to be lost after an extended period of
  inactivity

 There could be a number of reasons that this occurs.  Perhaps a network
 issue is causing them to be disconnected or the database may be timing them
 out.  At any rate, it's not likely that the problem would be caused by the
 removeAbandoned / abandonedTimeout settings, unless you application is
 not properly returning connections to the connection pool.


 https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Preventing_database_connection_pool_leaks


  (for a web application).  And the only way to get the connections to
  work
  again is to restart tomcat.
 
  My tomcat.jdbc.pool.Datasource settings have:
 
   property name=maxActive value=100/
  property name=maxIdle value=30/
  property name=maxWait value=1000/
  property name=defaultAutoCommit value=true/
  property name=removeAbandoned value=true/
  property name=removeAbandonedTimeout value=60/
 

 You probably want to add testOnBorrow=true and validationQuery=SELECT
 1  (or some other valid query for your DB).  See the following link for an
 explanation of those properties.

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

 This will cause your connections to be validated prior to their use by
 your application.  Stale connections will be removed and replaced with new,
 working connections.

 
  Is it the removedAbonded and abandonedTimeout?  Does it mean after
  60
  seconds, remove the connection from the pool?

 No.  See either of the links I've referenced above for an explanation of
 these settings.

 
  I guess what I need is a minActive setting then?
 

 There's no minActive setting.  You have minIdle, but I don't think
 that would help here.

 Dan





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




Re: jdbc pool properties

2012-04-04 Thread Pid
On 04/04/2012 12:08, S Ahmed wrote:
 My db connections seem to be lost after an extended period of inactivity
 (for a web application).  And the only way to get the connections to work
 again is to restart tomcat.
 
 My tomcat.jdbc.pool.Datasource settings have:
 
  property name=maxActive value=100/
 property name=maxIdle value=30/
 property name=maxWait value=1000/
 property name=defaultAutoCommit value=true/
 property name=removeAbandoned value=true/
 property name=removeAbandonedTimeout value=60/
 
 
 Is it the removedAbonded and abandonedTimeout?  Does it mean after 60
 seconds, remove the connection from the pool?
 
 I guess what I need is a minActive setting then?

Do you have a connection validation query and test set?

E.g. testOnBorrow=true?


p


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: jdbc pool properties

2012-04-04 Thread Daniel Mikusa


- Original Message -
 My db connections seem to be lost after an extended period of
 inactivity

There could be a number of reasons that this occurs.  Perhaps a network issue 
is causing them to be disconnected or the database may be timing them out.  At 
any rate, it's not likely that the problem would be caused by the 
removeAbandoned / abandonedTimeout settings, unless you application is not 
properly returning connections to the connection pool.

  
https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Preventing_database_connection_pool_leaks


 (for a web application).  And the only way to get the connections to
 work
 again is to restart tomcat.
 
 My tomcat.jdbc.pool.Datasource settings have:
 
  property name=maxActive value=100/
 property name=maxIdle value=30/
 property name=maxWait value=1000/
 property name=defaultAutoCommit value=true/
 property name=removeAbandoned value=true/
 property name=removeAbandonedTimeout value=60/
 

You probably want to add testOnBorrow=true and validationQuery=SELECT 1  
(or some other valid query for your DB).  See the following link for an 
explanation of those properties.

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

This will cause your connections to be validated prior to their use by your 
application.  Stale connections will be removed and replaced with new, working 
connections.

 
 Is it the removedAbonded and abandonedTimeout?  Does it mean after
 60
 seconds, remove the connection from the pool?

No.  See either of the links I've referenced above for an explanation of these 
settings.

 
 I guess what I need is a minActive setting then?
 

There's no minActive setting.  You have minIdle, but I don't think that 
would help here.

Dan





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



RE: jdbc pool properties

2012-04-04 Thread Propes, Barry L
There are some databases that do go in and periodically kill off connections, 
aside from the Tomcat settings.

In addition to testOnBorrow=true, I also had two other attributes, but not sure 
if Tomcat 7.0 uses them or not, as I'm on 6.0.29.

testOnBorrow=true
timeBetweenEvictionRunsMillis=-1
minEvictableIdleTimeMillis=28800



-Original Message-
From: Daniel Mikusa [mailto:dmik...@vmware.com]
Sent: Wednesday, April 04, 2012 7:46 AM
To: Tomcat Users List
Subject: Re: jdbc pool properties



- Original Message -
 My db connections seem to be lost after an extended period of
 inactivity

There could be a number of reasons that this occurs.  Perhaps a network issue 
is causing them to be disconnected or the database may be timing them out.  At 
any rate, it's not likely that the problem would be caused by the 
removeAbandoned / abandonedTimeout settings, unless you application is not 
properly returning connections to the connection pool.

  
https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Preventing_database_connection_pool_leaks


 (for a web application).  And the only way to get the connections to
 work again is to restart tomcat.

 My tomcat.jdbc.pool.Datasource settings have:

  property name=maxActive value=100/
 property name=maxIdle value=30/
 property name=maxWait value=1000/
 property name=defaultAutoCommit value=true/
 property name=removeAbandoned value=true/
 property name=removeAbandonedTimeout value=60/


You probably want to add testOnBorrow=true and validationQuery=SELECT 1  
(or some other valid query for your DB).  See the following link for an 
explanation of those properties.

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

This will cause your connections to be validated prior to their use by your 
application.  Stale connections will be removed and replaced with new, working 
connections.


 Is it the removedAbonded and abandonedTimeout?  Does it mean after 60
 seconds, remove the connection from the pool?

No.  See either of the links I've referenced above for an explanation of these 
settings.


 I guess what I need is a minActive setting then?


There's no minActive setting.  You have minIdle, but I don't think that 
would help here.

Dan





-
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: jdbc pool properties

2012-04-04 Thread Filip Hanik Mailing Lists
 There are some databases that do go in and periodically kill off
 connections, aside from the Tomcat settings.

you may want to explore the maxAge option for this, as we can disconnect and 
create new connections before the DB does kills it as long lived

- Original Message -
 From: Barry L Propes barry.l.pro...@citi.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, April 4, 2012 7:53:26 AM
 Subject: RE: jdbc pool properties
 
 There are some databases that do go in and periodically kill off
 connections, aside from the Tomcat settings.
 
 In addition to testOnBorrow=true, I also had two other attributes,
 but not sure if Tomcat 7.0 uses them or not, as I'm on 6.0.29.
 
 testOnBorrow=true
 timeBetweenEvictionRunsMillis=-1
 minEvictableIdleTimeMillis=28800
 
 
 
 -Original Message-
 From: Daniel Mikusa [mailto:dmik...@vmware.com]
 Sent: Wednesday, April 04, 2012 7:46 AM
 To: Tomcat Users List
 Subject: Re: jdbc pool properties
 
 
 
 - Original Message -
  My db connections seem to be lost after an extended period of
  inactivity
 
 There could be a number of reasons that this occurs.  Perhaps a
 network issue is causing them to be disconnected or the database may
 be timing them out.  At any rate, it's not likely that the problem
 would be caused by the removeAbandoned / abandonedTimeout
 settings, unless you application is not properly returning
 connections to the connection pool.
 
   
 https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Preventing_database_connection_pool_leaks
 
 
  (for a web application).  And the only way to get the connections
  to
  work again is to restart tomcat.
 
  My tomcat.jdbc.pool.Datasource settings have:
 
   property name=maxActive value=100/
  property name=maxIdle value=30/
  property name=maxWait value=1000/
  property name=defaultAutoCommit value=true/
  property name=removeAbandoned value=true/
  property name=removeAbandonedTimeout value=60/
 
 
 You probably want to add testOnBorrow=true and
 validationQuery=SELECT 1  (or some other valid query for your DB).
  See the following link for an explanation of those properties.
 
   https://commons.apache.org/dbcp/configuration.html
 
 This will cause your connections to be validated prior to their use
 by your application.  Stale connections will be removed and replaced
 with new, working connections.
 
 
  Is it the removedAbonded and abandonedTimeout?  Does it mean after
  60
  seconds, remove the connection from the pool?
 
 No.  See either of the links I've referenced above for an explanation
 of these settings.
 
 
  I guess what I need is a minActive setting then?
 
 
 There's no minActive setting.  You have minIdle, but I don't
 think that would help here.
 
 Dan
 
 
 
 
 
 -
 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
 
 

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



Re: [JDBC Pool] PoolCleaner creates some sort of memory

2012-04-04 Thread Filip Hanik Mailing Lists
I'll take a look at the test failures, but yes you can ignore them. Tomcat 
7.0.27 will have the fix included, about to be released shortly
building it is easy, builds with both maven and ant

Filip

- Original Message -
 From: Michael Osipov michael.osi...@siemens.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Friday, March 30, 2012 2:05:50 AM
 Subject: RE: [JDBC Pool] PoolCleaner creates some sort of memory
 
 Konstantin Kolinko wrote:
  2012/3/30 Osipov, Michael michael.osi...@siemens.com:
  Filip Hanik (mailing lists) wrote:
  http://svn.apache.org/viewvc?view=revisionrevision=1306946
  
  Thanks for the patch, I am having trouble to build from source. I
  do
  have some test failures, should I ignore them and go on?
  
  Please be more specific. In what tests?
 
 Have a look at this: http://pastebin.com/kiHLF6D9
 -
 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: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-30 Thread Osipov, Michael
Filip Hanik (mailing lists) wrote:
 http://svn.apache.org/viewvc?view=revisionrevision=1306946

Thanks for the patch, I am having trouble to build from source. I do have some 
test failures, should I ignore them and go on?
Another one, can we have a clearer name for the thread, e.g. like the I have 
suggested in a previous mail?

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



Re: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-30 Thread Konstantin Kolinko
2012/3/30 Osipov, Michael michael.osi...@siemens.com:
 Filip Hanik (mailing lists) wrote:
 http://svn.apache.org/viewvc?view=revisionrevision=1306946

 Thanks for the patch, I am having trouble to build from source. I do have 
 some test failures, should I ignore them and go on?

Please be more specific. In what tests?


 Another one, can we have a clearer name for the thread, e.g. like the I have 
 suggested in a previous mail?


Best regards,
Konstantin Kolinko

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



RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-30 Thread Osipov, Michael
Konstantin Kolinko wrote:
 2012/3/30 Osipov, Michael michael.osi...@siemens.com:
 Filip Hanik (mailing lists) wrote:
 http://svn.apache.org/viewvc?view=revisionrevision=1306946
 
 Thanks for the patch, I am having trouble to build from source. I do
 have some test failures, should I ignore them and go on? 
 
 Please be more specific. In what tests?

Have a look at this: http://pastebin.com/kiHLF6D9
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-29 Thread Osipov, Michael
Filip Hanik (mailing lists) wrote:
 PoolCleaner is a static singleton. The pool cleaner thread will not
 be removed until all JDBC pools have been stopped. 
 So, yes, one application can be the one that starts the thread, but
 not necessarily the one that stops it 

Filip,

I have already noticed that but the point is that the log message is misleading 
as same as the name of the thread. Something like 'Tomcat JBDC Pool Cleaner 
Task would be much clearer.

Mike

RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-29 Thread Filip Hanik (mailing lists)
http://svn.apache.org/viewvc?view=revisionrevision=1306946



 -Original Message-
 From: Osipov, Michael [mailto:michael.osi...@siemens.com]
 Sent: Thursday, March 29, 2012 1:36 AM
 To: Tomcat Users List
 Subject: RE: [JDBC Pool] PoolCleaner creates some sort of memory
 



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



Re: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-28 Thread Konstantin Kolinko
2012/3/28 Osipov, Michael michael.osi...@siemens.com:
 Hi folks,

 Recently this started to pop up in my logs:
 23.03.2012 14:12:28 org.apache.catalina.loader.WebappClassLoader 
 clearReferencesThreads
 SCHWERWIEGEND: The web application [/ket] appears to have started a thread 
 named [PoolCleaner[18291494:1332172047553]] but has failed to stop it. This 
 is very likely to create a memory leak.

 There is some similar thread [1] which had no real result.

 I am on Tomcat 6.0.35, all DataSources are created in the context.xml file. 
 All DataSources are cleaned up (closed) with a context.xml Listener. The JDBC 
 Pool is version 7.0.26.

 As far as my debug sessions have revealed (with attached VisualVM), it does 
 not matter how many apps you deploy the PoolCleanTimer thread is created only 
 once and retained until all apps have been stopped or removed. This makes 
 Tomcat think that this is a memory leak.

 Is there a way to associate this thread with another class loader in order to 
 avoid this problem or create multiple threads or simple ignore this warning 
 which is not a solution for those who face that issue too?

Is there a way to start it before webapps are started?

Something similar exists in the following listener:

Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener
/

At Tomcat startup it calls different API methods that are known to
create such classloader-bound objects.

 Is there a way to associate this thread with another class loader

Thread.setContextClassLoader() ? But IIRC this method is not thread-safe.


 Besides that, the numbers in the thread name are not very informative, the 
 classloader hashcode and timestamp did not really help to to identify 
 anything. Can this be improved?

What would you like to see there? Thread names are not under our
control. Anything else that can be obtained through API calls can be
added.

Suggestions are welcome. See the code -- search for
webappClassLoader.warnThread
in org/apache/catalina/loader/WebappClassLoader.java


 [1] http://www.mail-archive.com/users@tomcat.apache.org/msg87350.html


Best regards,
Konstantin Kolinko

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



RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-28 Thread Osipov, Michael
Konstantin Kolinko wrote:
 2012/3/28 Osipov, Michael michael.osi...@siemens.com:
 Hi folks,
 
 Recently this started to pop up in my logs:
 23.03.2012 14:12:28 org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads 
 SCHWERWIEGEND: The web application [/ket] appears to have started a
 thread named [PoolCleaner[18291494:1332172047553]] but has failed to
 stop it. This is very likely to create a memory leak.  
 
 There is some similar thread [1] which had no real result.
 
 I am on Tomcat 6.0.35, all DataSources are created in the
 context.xml file. All DataSources are cleaned up (closed) with a
 context.xml Listener. The JDBC Pool is version 7.0.26.  
 
 As far as my debug sessions have revealed (with attached VisualVM),
 it does not matter how many apps you deploy the PoolCleanTimer
 thread is created only once and retained until all apps have been
 stopped or removed. This makes Tomcat think that this is a memory
 leak.
 
 Is there a way to associate this thread with another class loader in
 order to avoid this problem or create multiple threads or simple
 ignore this warning which is not a solution for those who face that
 issue too?   
 
 Is there a way to start it before webapps are started?
 
 Something similar exists in the following listener:
 
 Listener
 className=org.apache.catalina.core.JreMemoryLeakPreventionListener
 / 
 
 At Tomcat startup it calls different API methods that are known to
 create such classloader-bound objects.
 
 Is there a way to associate this thread with another class loader
 
 Thread.setContextClassLoader() ? But IIRC this method is not
 thread-safe. 

I am aware of that method but that was not my point.
I guess that could best answered by Mark or Filip. If this TimerTask could be 
associated with the Bootstrap CL, there would be no warning.

 Besides that, the numbers in the thread name are not very
 informative, the classloader hashcode and timestamp did not really
 help to to identify anything. Can this be improved?  
 
 What would you like to see there? Thread names are not under our
 control. Anything else that can be obtained through API calls can be
 added.
 
 Suggestions are welcome. See the code -- search for
 webappClassLoader.warnThread
 in org/apache/catalina/loader/WebappClassLoader.java

The warning itself is ok but not the thread name. The thread name here is under 
implementor's control. See here [1]. The name can easily be confused with 
Oracle's LDAP Connection PoolCleaner.
Something Tomcat JDBC Pool Cleaner[hexid] would have helped me to find that 
one way faster.

[1] 
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?view=markup#l1216


With best regards,
Michael Osipov

Siemens AG
Industry Sector
Drive Technologies Division
I DT IT LD BLN
Nonnendammallee 72
13629 Berlin, Germany
mailto:michael.osi...@siemens.com

Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard
Cromme; Managing Board: Peter Loescher, Chairman, President and Chief
Executive Officer; Roland Busch, Brigitte Ederer, Klaus Helmrich, Joe
Kaeser, Barbara Kux, Hermann Requardt, Siegfried Russwurm, Peter Y.
Solmssen, Michael Suess; Registered offices: Berlin and Munich,
Germany; Commercial registries: Berlin Charlottenburg, HRB 12300,
Munich, HRB 6684; WEEE-Reg.-No. DE 23691322  
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-28 Thread Filip Hanik (mailing lists)
PoolCleaner is a static singleton. The pool cleaner thread will not be removed 
until all JDBC pools have been stopped.
So, yes, one application can be the one that starts the thread, but not 
necessarily the one that stops it

Filip

 -Original Message-
 From: Osipov, Michael [mailto:michael.osi...@siemens.com]
 Sent: Wednesday, March 28, 2012 8:29 AM
 To: users@tomcat.apache.org
 Subject: [JDBC Pool] PoolCleaner creates some sort of memory
 
 Hi folks,
 
 Recently this started to pop up in my logs:
 23.03.2012 14:12:28 org.apache.catalina.loader.WebappClassLoader
 clearReferencesThreads
 SCHWERWIEGEND: The web application [/ket] appears to have started a
 thread named [PoolCleaner[18291494:1332172047553]] but has failed to stop
 it. This is very likely to create a memory leak.
 
 There is some similar thread [1] which had no real result.
 
 I am on Tomcat 6.0.35, all DataSources are created in the context.xml file. 
 All
 DataSources are cleaned up (closed) with a context.xml Listener. The JDBC
 Pool is version 7.0.26.
 
 As far as my debug sessions have revealed (with attached VisualVM), it does
 not matter how many apps you deploy the PoolCleanTimer thread is created
 only once and retained until all apps have been stopped or removed. This
 makes Tomcat think that this is a memory leak.
 
 Is there a way to associate this thread with another class loader in order to
 avoid this problem or create multiple threads or simple ignore this warning
 which is not a solution for those who face that issue too?
 
 Besides that, the numbers in the thread name are not very informative, the
 classloader hashcode and timestamp did not really help to to identify
 anything. Can this be improved?
 
 [1] http://www.mail-archive.com/users@tomcat.apache.org/msg87350.html
 
 With best regards,
 Michael Osipov
 -
 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: [JDBC Pool] PoolCleaner creates some sort of memory

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

Filip,

On 3/28/12 12:00 PM, Filip Hanik (mailing lists) wrote:
 PoolCleaner is a static singleton. The pool cleaner thread will not
 be removed until all JDBC pools have been stopped. So, yes, one
 application can be the one that starts the thread, but not
 necessarily the one that stops it

Is there any reason not to associate the thread with the
WebappClassLoader's parent? Otherwise, this will pin the first webapp
to use tomcat-pool in memory until all webapps have been undeployed,
right?

- -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/

iEYEARECAAYFAk9zPQkACgkQ9CaO5/Lv0PD7wwCeOR3bVeJOk6fyWsTtzE3Fpbzm
Bk8AnjrsNqyp3zsHexJhIuLumEgZ1fsj
=pI1I
-END PGP SIGNATURE-

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



RE: [JDBC Pool] PoolCleaner creates some sort of memory

2012-03-28 Thread Filip Hanik (mailing lists)
: SHA1
 
 Filip,
 
 On 3/28/12 12:00 PM, Filip Hanik (mailing lists) wrote:
  PoolCleaner is a static singleton. The pool cleaner thread will not
  be removed until all JDBC pools have been stopped. So, yes, one
  application can be the one that starts the thread, but not
  necessarily the one that stops it
 
 Is there any reason not to associate the thread with the
 WebappClassLoader's parent? Otherwise, this will pin the first webapp
 to use tomcat-pool in memory until all webapps have been undeployed,
 right?
[Filip Hanik] 

Correct, I can add in a fix for this to force the context classloader to be the 
same as the pool while it is starting the thread

 
 - -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/
 
 iEYEARECAAYFAk9zPQkACgkQ9CaO5/Lv0PD7wwCeOR3bVeJOk6fyWsTtzE3Fp
 bzm
 Bk8AnjrsNqyp3zsHexJhIuLumEgZ1fsj
 =pI1I
 -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: jdbc driver location in TC 7

2012-03-26 Thread Terence M. Bandoian

 On 1:59 PM, Pid * wrote:

On 25 Mar 2012, at 03:10, Terence M. Bandoiantere...@tmbsw.com  wrote:


On 1:59 PM, Pid * wrote:

On 23 Mar 2012, at 21:59, David Kerberdcker...@verizon.net   wrote:


On 3/23/2012 6:51 PM, Terence M. Bandoian wrote:

On 1:59 PM, David kerber wrote:

On 3/23/2012 11:19 AM, Caldarale, Charles R wrote:

From: David kerber [mailto:dcker...@verizon.net]
Subject: jdbc driver location in TC 7
Where is the recommended location for jdbc driver jars in TC7,
when I'm using separate CATALINA_HOME and CATALINA_BASE locations?

If you look in conf/catalina.properties, you'll see the order in which the 
common loader searches directories.


If it makes a difference, I am not using tomcat's connection
pooling; it's handled in my app.

That's a critical difference.


I generally would prefer to put it in my webapp's lib directory

That is the correct location, since Tomcat is not involved.

Great; thanks for confirming.

D


Hi, David-

I prefer the web app's lib directory as well but when I place the JDBC driver 
there, a memory leak detection error is logged when I stop Tomcat.  Not a big 
deal but I'd prefer not to have to explain.  When I move the JDBC driver to the 
Tomcat lib directory, the error is no longer logged.  (Tomcat 6)

Even better would be to fix your probable connection leak.  I had some too, 
when I went to a version that had the leak detection, but was able to fix them 
all.

D

Yup. Just deregister the DB driver on app stop using a ServletContexListener.


p


Thanks.  I'll give that a try.  Wouldn't I see a connection leak no matter 
where I placed the driver?

Only if you're not returning / cleaning up connection objects properly.



De-registering the driver may do the trick.

This addresses the driver leak  warning by Tomcat.


p




Exactly.

-Terence Bandoian


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



Re: jdbc driver location in TC 7

2012-03-26 Thread Terence M. Bandoian

 On 1:59 PM, Pid * wrote:

On 25 Mar 2012, at 03:10, Terence M. Bandoiantere...@tmbsw.com  wrote:


On 1:59 PM, Pid * wrote:

On 23 Mar 2012, at 21:59, David Kerberdcker...@verizon.net   wrote:


On 3/23/2012 6:51 PM, Terence M. Bandoian wrote:

On 1:59 PM, David kerber wrote:

On 3/23/2012 11:19 AM, Caldarale, Charles R wrote:

From: David kerber [mailto:dcker...@verizon.net]
Subject: jdbc driver location in TC 7
Where is the recommended location for jdbc driver jars in TC7,
when I'm using separate CATALINA_HOME and CATALINA_BASE locations?

If you look in conf/catalina.properties, you'll see the order in which the 
common loader searches directories.


If it makes a difference, I am not using tomcat's connection
pooling; it's handled in my app.

That's a critical difference.


I generally would prefer to put it in my webapp's lib directory

That is the correct location, since Tomcat is not involved.

Great; thanks for confirming.

D


Hi, David-

I prefer the web app's lib directory as well but when I place the JDBC driver 
there, a memory leak detection error is logged when I stop Tomcat.  Not a big 
deal but I'd prefer not to have to explain.  When I move the JDBC driver to the 
Tomcat lib directory, the error is no longer logged.  (Tomcat 6)

Even better would be to fix your probable connection leak.  I had some too, 
when I went to a version that had the leak detection, but was able to fix them 
all.

D

Yup. Just deregister the DB driver on app stop using a ServletContexListener.


p


Thanks.  I'll give that a try.  Wouldn't I see a connection leak no matter 
where I placed the driver?

Only if you're not returning / cleaning up connection objects properly.



De-registering the driver may do the trick.

This addresses the driver leak  warning by Tomcat.


p



Thanks again.  Explicitly de-registering the driver eliminated the 
Tomcat error message with the driver located in WEB-INF/lib.  From what 
I've read, JDBC 4.0 drivers automatically register themselves with 
DriverManager but I haven't seen anything about automatic 
de-registration.  Apparently, Tomcat (6.0.29) takes care of that if the 
driver is located in the Tomcat lib directory but not if it is located 
in web application's lib directory.  Or maybe de-registration isn't a 
concern when Tomcat is shutting down.


-Terence Bandoian


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



Re: jdbc driver location in TC 7

2012-03-26 Thread Pid
On 26/03/2012 12:30, Terence M. Bandoian wrote:
  On 1:59 PM, Pid * wrote:
 On 25 Mar 2012, at 03:10, Terence M. Bandoiantere...@tmbsw.com 
 wrote:

 On 1:59 PM, Pid * wrote:
 On 23 Mar 2012, at 21:59, David Kerberdcker...@verizon.net   wrote:

 On 3/23/2012 6:51 PM, Terence M. Bandoian wrote:
 On 1:59 PM, David kerber wrote:
 On 3/23/2012 11:19 AM, Caldarale, Charles R wrote:
 From: David kerber [mailto:dcker...@verizon.net]
 Subject: jdbc driver location in TC 7
 Where is the recommended location for jdbc driver jars in TC7,
 when I'm using separate CATALINA_HOME and CATALINA_BASE locations?
 If you look in conf/catalina.properties, you'll see the order in
 which the common loader searches directories.

 If it makes a difference, I am not using tomcat's connection
 pooling; it's handled in my app.
 That's a critical difference.

 I generally would prefer to put it in my webapp's lib directory
 That is the correct location, since Tomcat is not involved.
 Great; thanks for confirming.

 D

 Hi, David-

 I prefer the web app's lib directory as well but when I place the
 JDBC driver there, a memory leak detection error is logged when I
 stop Tomcat.  Not a big deal but I'd prefer not to have to
 explain.  When I move the JDBC driver to the Tomcat lib directory,
 the error is no longer logged.  (Tomcat 6)
 Even better would be to fix your probable connection leak.  I had
 some too, when I went to a version that had the leak detection, but
 was able to fix them all.

 D
 Yup. Just deregister the DB driver on app stop using a
 ServletContexListener.


 p

 Thanks.  I'll give that a try.  Wouldn't I see a connection leak no
 matter where I placed the driver?
 Only if you're not returning / cleaning up connection objects properly.


 De-registering the driver may do the trick.
 This addresses the driver leak  warning by Tomcat.


 p
 
 
 Thanks again.  Explicitly de-registering the driver eliminated the
 Tomcat error message with the driver located in WEB-INF/lib.  From what
 I've read, JDBC 4.0 drivers automatically register themselves with
 DriverManager but I haven't seen anything about automatic
 de-registration.  Apparently, Tomcat (6.0.29) takes care of that if the
 driver is located in the Tomcat lib directory but not if it is located
 in web application's lib directory.  Or maybe de-registration isn't a
 concern when Tomcat is shutting down.

The other way round, I think.  Read the warning message.


p

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


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


  1   2   3   4   >