To: Tomcat Users List
Subject: Re: ConnectionPool question
As far as I remember, abandoned is a connection that was not closed. So if
you call recycle on a connection it will not generate abandoned message. The
messages that you see are from connections that you do not close. I also
remember
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Subject: RE: ConnectionPool question
When I FIRST make a DB query through one of my JSPs/servlets, I get
this msg printed to the console.
AbandonedObjectPool is used
(org.apache.commons.dbcp.abandonedobjectp...@b32627
Users List
Subject: RE: ConnectionPool question
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Subject: RE: ConnectionPool question
When I FIRST make a DB query through one of my JSPs/servlets, I get
this msg printed to the console.
AbandonedObjectPool is used
2:52 PM
To: Tomcat Users List
Subject: RE: ConnectionPool question
From: Propes, Barry L [mailto:barry.l.pro...@citi.com]
Subject: RE: ConnectionPool question
When I FIRST make a DB query through one of my JSPs/servlets, I get
this msg printed to the console.
AbandonedObjectPool
Hi,
Elli,
On 11/4/2009 7:01 PM, Elli Albek wrote:
I also
remember that closing a connection closes statements and result sets, but it
has been a while since I read the source.
Pooled connections are almost certainly not behaving this way. This has
been discussed at least twice in the
HOLY MOLY I am getting a TON of abandoned connection warnings now. I
see I have logAbandoned=true. My Catalina log grew fast! Now here is a
question, everytime I recycle a connection (close RS, statement, and the
connection) does it place it back into the pool or is that what the
abandoned
:56:20 GMT +01:00 Amsterdam / Berlin / Bern
/ Rome / Stockholm / Vienna
Subject: Re: ConnectionPool question
HOLY MOLY I am getting a TON of abandoned connection warnings now. I
see I have logAbandoned=true. My Catalina log grew fast! Now here is a
question, everytime I recycle a connection
-
From: Josh Gooding josh.good...@gmail.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, 4 November, 2009 14:56:20 GMT +01:00 Amsterdam / Berlin /
Bern / Rome / Stockholm / Vienna
Subject: Re: ConnectionPool question
HOLY MOLY I am getting a TON of abandoned connection
From: Josh Gooding [mailto:josh.good...@gmail.com]
Subject: Re: ConnectionPool question
everytime I recycle a connection (close RS, statement, and the
connection) does it place it back into the pool or is that what the
abandoned connection messages are for letting me know they were
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 11/3/2009 3:24 PM, Josh Gooding wrote:
If I close the RS, can I still use the MD?
I see you've already answered this, but note the error is that the
Connection is closed, not the ResultSet.
I would expect that ResultSetMetaData requires
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Chuck,
On 11/4/2009 10:06 AM, Caldarale, Charles R wrote:
If a webapp fails to close a
connection wrapper and its associated real connection stays idle
beyond the configured limit, the association between the wrapper and
real connection is
Chris,
I would imagine that you are correct, unless I store the RSMD in anther
object (like a Map or AL).
Now that I have started closing my resources something strange has actually
happened now. I've hit the connectionpool limit faster.
I was digging and realized that I changed my context.xml
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Subject: Re: ConnectionPool question
I believe both the real connection and the wrapper are discarded.
Yes; I should have said the real connection is closed and a new real one
created for the pool.
- Chuck
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Chuck,
On 11/4/2009 1:17 PM, Caldarale, Charles R wrote:
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Subject: Re: ConnectionPool question
I believe both the real connection and the wrapper are discarded.
Yes; I should
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 11/4/2009 12:11 PM, Josh Gooding wrote:
type=javax.sql.DataSource
[snip]
res-typejavax.sql.DataSource/res-type
I believe it is these types that must match, and they do. Don't change a
thing.
- -chris
-BEGIN PGP
As far as I remember, abandoned is a connection that was not closed. So if
you call recycle on a connection it will not generate abandoned message. The
messages that you see are from connections that you do not close. I also
remember that closing a connection closes statements and result sets, but
If I close the RS, can I still use the MD?
On Tue, Nov 3, 2009 at 3:13 PM, Elli Albek e...@sustainlane.com wrote:
No, you do not need to close the XXXMetaData classes.
E
On Tue, Nov 3, 2009 at 12:02 PM, Josh Gooding josh.good...@gmail.com
wrote:
One more question on bleeding resources.
Elle,
I am going to dig into this code and check it out. I want to know more
about how to use threadlocal and filters. (Sorry I'm not as experienced in
Tomcat as some for you gurus here).
The code looks promising and I like the 2nd option due to the fact that each
HTTP req. only has one
nevermind. I get:
javax.servlet.ServletException:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
No operations allowed after connection closed.
Guess that answers my question.
On Tue, Nov 3, 2009 at 3:24 PM, Josh Gooding josh.good...@gmail.com wrote:
If I close the
One more question on bleeding resources. When closing RS / statement /
connections. Do I have to do anything with the MetaData if I got that as
well? (I.E Do I explicitly have to close the metadata as well?)
Josh
On Tue, Nov 3, 2009 at 2:01 PM, Josh Gooding josh.good...@gmail.com wrote:
No, you do not need to close the XXXMetaData classes.
E
On Tue, Nov 3, 2009 at 12:02 PM, Josh Gooding josh.good...@gmail.comwrote:
One more question on bleeding resources. When closing RS / statement /
connections. Do I have to do anything with the MetaData if I got that as
well? (I.E Do
Here is some idea for you:
First, you have two static methods to get and return the connection inside a
listener class. Those methods do not have anything to do with the listener
(which is an instance), and also and also do not need synchronization.
Synchronizing on getConnection can be a big
Oops, I had a copy paste error. Version 2 has the filter method twice.
Ignore the first, use the second. Notice this code was written in an email
client, not an IDE :)
E
2009/10/31 Josh Gooding josh.good...@gmail.com:
(...)
and I am getting a tomcat startup exception:
WARNING: Unexpected exception resolving reference
java.lang.IllegalArgumentException
at java.util.concurrent.ArrayBlockingQueue.init(Unknown Source)
at
It seems as though you cannot set the maxActive to -1 as you can in the
javax.sql.ConnectionPool for unlimited.
On Mon, Nov 2, 2009 at 4:36 AM, Konstantin Kolinko
knst.koli...@gmail.comwrote:
2009/10/31 Josh Gooding josh.good...@gmail.com:
(...)
and I am getting a tomcat startup exception:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Elli,
On 11/2/2009 4:08 AM, Elli Albek wrote:
I think you can have a solution without changing your code.
Try something like this:
getConnection() static method should get the connection, and add it to a
list that you keep in threadlocal.
hi Josh, calling Connection.close() does not close statements and
resultsets.
There is an interceptor you can configure called StatementFinalizer that
does exactly that during the close call.
Filip
On 10/29/2009 07:17 PM, Josh Gooding wrote:
I wrote some code on top of the Tomcat's
I have been reading it and ALMOST chimed in, but decided to read farther
first. While I asked a question about it on the sun forums and got slammed
for a class I wrote and posted about why a ConnectionPool would ever have to
implement ServletContextListener. basically I was told to write in
AHH, I will read the API for the StatementFinalizer. I was looking at
something to do that. Thank you Filip!
On Fri, Oct 30, 2009 at 9:53 AM, Filip Hanik - Dev Lists devli...@hanik.com
wrote:
hi Josh, calling Connection.close() does not close statements and
resultsets.
There is an
Hey what API holds the statementFinalizer?
On Fri, Oct 30, 2009 at 9:57 AM, Josh Gooding josh.good...@gmail.comwrote:
AHH, I will read the API for the StatementFinalizer. I was looking at
something to do that. Thank you Filip!
On Fri, Oct 30, 2009 at 9:53 AM, Filip Hanik - Dev Lists
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 10/30/2009 9:54 AM, Josh Gooding wrote:
While I asked a question about it on the sun forums and got slammed
for a class I wrote and posted about why a ConnectionPool would ever have to
implement ServletContextListener. basically I was
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Filip,
On 10/30/2009 9:53 AM, Filip Hanik - Dev Lists wrote:
There is an interceptor you can configure called StatementFinalizer that
does exactly that during the close call.
Can you point me to some documentation for this? The only thing I can
http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/StatementFinalizer.java?view=log
Filip
On 10/30/2009 08:34 AM, Josh Gooding wrote:
Hey what API holds the statementFinalizer?
On Fri, Oct 30, 2009 at 9:57 AM, Josh
look at jdbc-pool.html it has all the info, here are examples out of it
Configuration
Resource name=jdbc/TestDB
auth=Container
type=javax.sql.DataSource
factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
testWhileIdle=true
On Fri, Oct 30, 2009 at 11:33 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
Heh. Obviously, someone hasn't worked in the real world. Did he realize
that writing to the contract in this case could potentially bring-down
the database server?
Eh, I just let it go. I'm beyond
Wait a second. What I am seeing from you Filip and what I have in my
context.xml are similar:
Context
WatchedResourceWEB-INF/web.xml/WatchedResource
Resource
name=jdbc/RealmDB auth=Container type=javax.sql.DataSource
username=root password=password
nope, you're using commons-dbcp, see the factory attribute in my config
Filip
On 10/30/2009 12:22 PM, Josh Gooding wrote:
Wait a second. What I am seeing from you Filip and what I have in my
context.xml are similar:
Context
WatchedResourceWEB-INF/web.xml/WatchedResource
Resource
I also found this tid bit lying around. It get's a connection, but doesn't
close the statement.
public static void closeResources(ResultSet rs) throws
AardvarkResourceException {
try {
Statement s = rs.getStatement();
if (s != null) { // ResultSets produced by
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 10/30/2009 2:10 PM, Josh Gooding wrote:
Oh this code BLEEDS resources. The only semi annoyance is that the methods
that get RS's are usually returned like:
return
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 10/30/2009 2:42 PM, Josh Gooding wrote:
I also found this tid bit lying around. It get's a connection, but doesn't
close the statement.
Might I suggest the following changes:
public static void closeResources(ResultSet rs) throws
-Original Message-
From: Josh Gooding [mailto:josh.good...@gmail.com]
Sent: Friday, October 30, 2009 1:11 PM
To: Tomcat Users List
Subject: Re: ConnectionPool question
This is not bad, but there is NO PLACE in the code that actively closes all of
the resources. Sometimes the code
Hey Filip, I do not have /jdbc/pool/DataSourceFactory in my
tomcat-dbcp.jar. Is there some other place I should look?
My jar's structure goes as:
org/apache/tomcat/
dbcp
jocl
pool
Under the dbcp I have a DataSourceConnectionFactory.class (which I am making
an assumption that is what it is.)
: Josh Gooding [mailto:josh.good...@gmail.com]
Sent: Friday, October 30, 2009 1:43 PM
To: Tomcat Users List
Subject: Re: ConnectionPool question
I also found this tid bit lying around. It get's a connection, but doesn't
close the statement.
public static void closeResources(ResultSet rs
: ConnectionPool question
I also found this tid bit lying around. It get's a connection, but doesn't
close the statement.
public static void closeResources(ResultSet rs) throws
AardvarkResourceException {
try {
Statement s = rs.getStatement();
if (s != null
When you said you used the Tomcat ConnectionPool class, I simply assumed
that you were using the new pool being developed at Tomcat
http://people.apache.org/~fhanik/jdbc-pool/v1.0.7.1/
the org.apache.tomcat.dbcp is the same as the commons-dbcp, just renamed
to avoid class naming conflicts
.
Is the AardvarkResource a previously designated DB datasource class, written by
the previous developer?
-Original Message-
From: Josh Gooding [mailto:josh.good...@gmail.com]
Sent: Friday, October 30, 2009 3:32 PM
To: Tomcat Users List
Subject: Re: ConnectionPool question
Barry I
-
From: Josh Gooding [mailto:josh.good...@gmail.com]
Sent: Friday, October 30, 2009 1:23 PM
To: Tomcat Users List
Subject: Re: ConnectionPool question
Wait a second. What I am seeing from you Filip and what I have in my
context.xml are similar:
Context
WatchedResourceWEB-INF/web.xml
,
written by the previous developer?
-Original Message-
From: Josh Gooding [mailto:josh.good...@gmail.com]
Sent: Friday, October 30, 2009 3:32 PM
To: Tomcat Users List
Subject: Re: ConnectionPool question
Barry I changed the code to this:
public static void closeResources(ResultSet
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 10/30/2009 4:31 PM, Josh Gooding wrote:
public static void closeResources(ResultSet rs) throws
AardvarkResourceException {
Statement s = null;
Connection c = null;
try {
s = rs.getStatement();
Filip I grabbed the tomcat-jdbc.jar file and included it under the /lib
folder in my tomcat installation. I modified my context.xml's resource tag
to the following:
Resource
name=jdbc/RealmDB
auth=Container
type=javax.sql.DataSource
Chris,
I was looking at that earlier, wondering why it was put in there in the
first place. It just doesn't fit in. Sometimes you just hate to inherit
someone else's mess.
While there is another school of thought telling me to re-write the entire
DAO (which I could be willing to later on) for
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 10/29/2009 9:17 PM, Josh Gooding wrote:
I wrote some code on top of the Tomcat's ConnectionPool class. In regular
Java based programming if I close a ResultSet with connection.close(), this
frees up both the statement and resultset's
52 matches
Mail list logo