Re: What is the default ssl version and can I change it?

2023-06-14 Thread Shawn Heisey
On 6/13/23 20:30, rainbows appintment wrote: I encountered a problem when using this. After the SMTP server turned off support for tls1.0 and tls1.1, it now only supports tls1.2 and higher versions, and mail cannot be sent. I would like to ask can this be specified as ssl version tls1.2?and I

Re: [collections] The target Java version for 4.5

2023-06-14 Thread Shawn Heisey
On 6/14/23 10:58, Efremov, Rodion wrote: What Java version Collections 4.5 is being built for? 4.4 seems to rely on Java 1.8, yet I might contribute in the future my own data structure so I need to know whether my implementation may assume availability of all the JDK 9+ version syntax sugar

Re: Commons bsf

2023-02-01 Thread Shawn Heisey
On 2/1/23 06:20, Alex O'Ree wrote: I'm not sure I have commit permissions to that repo. It would be rather rude of me to just commit to a project I've never supported before. IMO All Apache committers are able to commit on the commons projects. There was an announcement a while back on that.

Re: [Text]

2021-09-01 Thread Shawn Heisey
On 9/1/2021 5:33 PM, Ted Teichrieb wrote: After a lot of googling to solve what I thought was a config issue, I finally checked the source code at https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/StringEscapeUtils.java

Re: Copying methods?

2019-03-03 Thread Shawn Heisey
On 3/3/2019 11:48 AM, Petko Hupka wrote: If I understand correctly your license of your lib I can modify and and use your product but what if i want only one method and I don't need whole library. Can I simply copy it in to my project?? The Apache license covers the code as well as the binary

Re: [DBCP] Possible to get query strings from datasource?

2018-05-08 Thread Shawn Heisey
On 5/6/2018 3:10 PM, Phil Steitz wrote: Above looks like it will work, but it introduces a synchronization bottleneck in your app.  If you have high concurrency and lots of queries being submitted, threads are going to line up waiting for the lock on the map. I believe that all the usages of

Re: [DBCP] Possible to get query strings from datasource?

2018-05-04 Thread Shawn Heisey
On 5/4/2018 6:15 PM, Shawn Heisey wrote: > The implementation looks clean to me, but I need something bad to happen > before I will know if it's actually working. I added a background thread that periodically logs pool stats.  At first, I never got it to line up with any actual database

Re: [DBCP] Possible to get query strings from datasource?

2018-05-04 Thread Shawn Heisey
On 5/4/2018 4:49 PM, Martin Gainty wrote: > MG>have a chat with your DBA on BasicDataSource validationQuery > MG>if this was Oracle it would be something like select 1 from DUAL This has me chuckling.   Let me put on my DBA hat (which doesn't fit all that well)... The server is MySQL.  I set the

Re: [DBCP] Possible to get query strings from datasource?

2018-05-04 Thread Shawn Heisey
On 5/4/2018 10:38 AM, Phil Steitz wrote: > The only thing close to this that you can do now is if you have > prepared statement pooling enabled, then via the JMX instrumentation > of commons pool you can see the output of statement.toString().   > See listAllObjects in GenericObjectPoolMXBean. 

[DBCP] Possible to get query strings from datasource?

2018-05-04 Thread Shawn Heisey
Using dbcp 2.2.0 with pool 2.5.0. If the only object I have access to is BasicDataSource, is it possible to obtain the SQL queries being executed by active connections in the pool right now?  If so, how would I go about doing that? At the moment I'm not using PreparedStatement, but I have

Re: [DBCP] troubleshooting pool activity (tomcat version)

2018-03-23 Thread Shawn Heisey
On 3/23/2018 5:19 PM, Phil Steitz wrote: > That's the documentation for the alternative pool.  Use this instead: > https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_(DBCP)_Configurations This does not really explain how to configure Tomcat.  It

Re: [DBCP] troubleshooting pool activity (tomcat version)

2018-03-22 Thread Shawn Heisey
First thing to do is thank you again for taking the time to help me.  Apache has great communities. On 3/22/2018 5:38 PM, Phil Steitz wrote: > You must be looking at documentation describing how to use the > alternative pool mentioned above (tomcat-jdbc).  The config you > posted is correct for

Re: [DBCP] troubleshooting pool activity (tomcat version)

2018-03-21 Thread Shawn Heisey
On 3/21/2018 1:31 AM, Mark Thomas wrote: >> and that we need to >> change the factory on our pool definitions. > I believe not. Tomcat's documentation seems to disagree with this point. It specifically says to use org.apache.tomcat.jdbc.pool.DataSourceFactory, and doesn't list any other valid

Re: [DBCP] troubleshooting pool activity (tomcat version)

2018-03-20 Thread Shawn Heisey
On 3/20/2018 9:49 PM, Phil Steitz wrote: First, find out what version of tomcat you are running.  Then look in the tomcat build file sources for the properties that define the dbcp and pool versions being used.  In TC 7, I am pretty sure the repackaged sources were always from release tags.  Ask

[DBCP] troubleshooting pool activity (tomcat version)

2018-03-20 Thread Shawn Heisey
I've written before, trying to track down problems with our database server getting too many connections. Based on what I can see of how my programs (using dbcp2) are working, everything seems to be fine there.  I've added logging to tell me how many idle and active connections there are in

Re: [DBCP] Connection pool not behaving as I expect

2018-03-01 Thread Shawn Heisey
On 3/1/2018 8:48 PM, Matt Sicker wrote: Take a look inside commons-pool for the instrumentation (e.g., JMX). You can also track usage on borrow and other leaks. Also, Tomcat uses DBCP as it is. I know I can get those numbers from the object pool, but at the point where I needed them, I don't

Re: [DBCP] Connection pool not behaving as I expect

2018-03-01 Thread Shawn Heisey
On 3/1/2018 4:46 PM, Gary Gregory wrote: I do not think this is a question I, or anyone here, can answer generically. I can read between that lines that you must feel frustrated and I certainly empathize with that. I think you might want to debug your application and come up with some parameters

[DBCP] Connection pool not behaving as I expect

2018-03-01 Thread Shawn Heisey
We have been having some problems lately where our MySQL server hits the max connection limit (600) and then everything breaks.  When I look into the problem, I find that our application servers have each made nearly a hundred connections to the DB and haven't closed any of them for hours. I'm

Re: [DBCP] Connection just obtained from datasource is invalid

2018-01-09 Thread Shawn Heisey
On 1/9/2018 8:31 AM, Gary Gregory wrote: Currious: are you using the current versions of DBCP and Pool? The last compile pulled down pool 2.5.0, dbcp 2.2.0, and mysql driver 5.1.45 (using ivy).  I haven't seen the problem since that compile (which also enabled testing connections on various

Re: [DBCP] Connection just obtained from datasource is invalid

2018-01-09 Thread Shawn Heisey
On 1/8/2018 11:19 PM, Chas Honton wrote: > Don’t forget about any proxies or routers between the client and the server. > Most infrastructure components will close quiescent connections (within > minutes) There are no proxies for the MySQL traffic.  The machines involved are on the same subnet

Re: [DBCP] Connection just obtained from datasource is invalid

2018-01-08 Thread Shawn Heisey
On 11/22/2017 5:00 PM, Phil Steitz wrote: > If the problem is the evictor closing a connection and having that > connection delivered to a client, the problem is almost certainly in > pool.  The thread-safety of the pool in this regard is engineered in > DefaultPooledObject, which is the wrapper

Re: [DBCP] Connection just obtained from datasource is invalid

2017-11-22 Thread Shawn Heisey
On 11/22/2017 12:04 PM, Phil Steitz wrote: > On 11/22/17 9:43 AM, Shawn Heisey wrote: >> I do have results from the isClosed method when the problem happens.  >> That method *does* return true. > That points to a Pool or DBCP bug, assuming you are sure that no > other t

Re: [DBCP] Connection just obtained from datasource is invalid

2017-11-22 Thread Shawn Heisey
On 11/22/2017 1:56 PM, Phil Steitz wrote: > You're not storing the connection somewhere in a possibly not > thread-safe way, are you? Not as far as I can tell.  Connections are mostly obtained within my "Database" class, which has static methods that get called from elsewhere in my code.  The

Re: [DBCP] Connection just obtained from datasource is invalid

2017-11-22 Thread Shawn Heisey
On 11/21/2017 1:01 PM, Phil Steitz wrote: > As I said in my first response, the most common explanation for this > kind of exception when using DBCP is that the underlying physical > connection is closed on the server (or network) side without DBCP > knowing about it.  And the most common cause of

Re: [DBCP] Connection just obtained from datasource is invalid

2017-11-21 Thread Shawn Heisey
On 11/16/2017 5:21 PM, Phil Steitz wrote: > That should not be possible, as once a connection has been checked > out, it is not eligible for eviction.  And even if it were evicted > by the pool, the pool would set the DelegatingConnection's closed > property to true so isValid would return false

Re: [DBCP] Connection just obtained from datasource is invalid

2017-11-21 Thread Shawn Heisey
On 11/17/2017 3:27 PM, Phil Steitz wrote: > OK, sorry I misread your initial post.  That means either the pool > agrees that the connection is closed (which would point to a pool or > DBCP bug) or the driver's isValid() on the underlying physical > connection is returning true (without throwing). 

Re: [DBCP] Connection just obtained from datasource is invalid

2017-11-17 Thread Shawn Heisey
On 11/16/2017 5:21 PM, Phil Steitz wrote: >> How can a connection that I *just* retrieved from the pool be closed? > Should not happen.  In most cases like this, it turns out not to be > the pool that closed the connection.  The most common causes of this > are network connectivity problems or the

Re: [EXTERNAL]Re: DBCP issuing more sessions than maxActive sessions in Oracle

2017-01-24 Thread Shawn Heisey
On 1/24/2017 5:36 PM, Romero, René wrote: > Guys, do you think dbcp-1.4.1 is going to come out soon? I'm more familiar with the Lucene/Solr project than Commons, but if I had to guess, I would say that you're unlikely to see a new 1.x version of dbcp or pool. The 1.4 version of dbcp was released

Re: [EXTERNAL]Re: DBCP issuing more sessions than maxActive sessions in Oracle

2017-01-24 Thread Shawn Heisey
On 1/24/2017 3:55 PM, Romero, René wrote: > We're running commons-dbcp-1.4 and commons-pool-1.6. To me, it sounds like > we're being impacted by this bug: > > https://issues.apache.org/jira/browse/DBCP-379 > > [DBCP-379] number of connections created has crossed more >

Re: I need to close the connection, not return it back to the Connection Pool

2016-12-22 Thread Shawn Heisey
On 12/22/2016 4:49 AM, 王钦 wrote: > When I use DBCP-1.4 in my work, I need to close the connection > which is generated by BasicDataSource. How can I do it? Close the > connection, while not returning it back to the Connection Pool. The PoolableConnection class (which I believe is the actual

[DBCP2] Timeout on PoolingDataSource#getConnection() ?

2015-04-30 Thread Shawn Heisey
I'm using dbcp2-2.1 and pool2-2.3. Is there any kind of timeout configurable (or even needed) when calling getConnection() on a PoolingDataSource? I was looking over my code for possible problems and realized that I have no idea whether this call might block indefinitely or whether it will

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-21 Thread Shawn Heisey
On 4/21/2015 6:28 PM, Phil Steitz wrote: Thanks for providing the full stack traces, Shawn. I assume the pool config is the same that you posted before, right? Also, the mysql driver seems to be taking initiative to try to clean up abandoned connections itself. That is holding some locks;

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-21 Thread Shawn Heisey
On 4/14/2015 6:06 AM, James Carman wrote: You may want to consider something like Spring's JdbcTemplate class to avoid a lot of this. I don't know anything about Spring, although I didn't know anything about DBCP either, before I wrote this code. I suspect that Spring is much larger and more

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-12 Thread Shawn Heisey
On 4/11/2015 8:48 AM, Phil Steitz wrote: What is going on in that thread is that it is blocked waiting for a connection to become available in the pool. There is no evidence of deadlock there - just pool exhaustion. The most likely culprit is application code that is failing to close

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-12 Thread Shawn Heisey
On 4/12/2015 9:16 AM, Phil Steitz wrote: Can you post your full pool config and info on versions of DBCP and POOL? Do you call isClosed() before closing a connection (not recommended - that is really the issue in the ticket you commented)? To make sure there is not an actual deadlock

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-12 Thread Shawn Heisey
On 4/12/2015 5:18 AM, Kristian Rosenvold wrote: I once had a library that allocated 2 connections to complete a transaction. Every now and then we'd deadlock the pool if number of concurrent transactions pool size, which could happen in load bursts. If you do a thread dump of your process and

Re: [DBCP] Apparent deadlock related to getConnection

2015-04-12 Thread Shawn Heisey
On 4/12/2015 12:43 PM, Phil Steitz wrote: On 4/12/15 10:31 AM, Shawn Heisey wrote: http://apaste.info/6pX Several methods, getSingleObject, getResultSet, closeResultSet, doUpdate can abandon connections on exception paths. You should insert finally blocks in these methods to ensure

Apparent DBCP deadlock related to getConnection

2015-04-11 Thread Shawn Heisey
I seem to be having a problem very similar to DBCP-398, using DBCP 2.1 with MySQL. https://issues.apache.org/jira/browse/DBCP-398 See the last couple of comments. I am not familiar with the code, so I can't confirm or refute Phil's comment that it looks normal, but I can say this: The problem