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
ailto:chuck.caldar...@unisys.com]
> Sent: Thursday, November 05, 2009 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
> >
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.
>
&
> 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.ab
04, 2009 6:02 PM
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 no
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, bu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Josh,
On 11/4/2009 12:11 PM, Josh Gooding wrote:
> type="javax.sql.DataSource"
[snip]
> javax.sql.DataSource
I believe it is these types that must match, and they do. Don't change a
thing.
- -chris
-BEGIN PGP SIGNATURE-
Ver
-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 ar
> 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.
-
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
-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 sev
-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 t
> 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
- Original Message -
> From: "Josh Gooding"
> To: "Tomcat Users List"
> 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 ab
rdam / 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 (close RS,
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
No, you do not need to close the XXXMetaData classes.
E
On Tue, Nov 3, 2009 at 12:02 PM, Josh Gooding wrote:
> 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
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 wrote:
> Elle,
>
> I am going to d
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 wrote:
> If I close the RS, can I still use the
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 connect
If I close the RS, can I still use the MD?
On Tue, Nov 3, 2009 at 3:13 PM, Elli Albek wrote:
> No, you do not need to close the XXXMetaData classes.
>
> E
>
> On Tue, Nov 3, 2009 at 12:02 PM, Josh Gooding >wrote:
>
> > One more question on bleeding resources. When closing RS / statement /
> >
-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
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
wrote:
> 2009/10/31 Josh Gooding :
> >(...)
> > and I am getting a tomcat startup exception:
> >
> > WARNING: Unexpected exception
2009/10/31 Josh Gooding :
>(...)
> and I am getting a tomcat startup exception:
>
> WARNING: Unexpected exception resolving reference
> java.lang.IllegalArgumentException
> at java.util.concurrent.ArrayBlockingQueue.(Unknown Source)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(Conn
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
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 bott
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 r
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:
and I am getting a tomcat startup exception:
WARNING: Unexpected exception resolving reference
java.lang.IllegalArgumentExceptio
-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()
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: ConnectionPo
, 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:
WEB-INF/web.xml
My ConnectionPool class:
import java.sql.Connection;
import java.sql.SQLException
, 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 rs
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
Fil
on gets recycled.
> Theoretically.
>
> Seems like you put a finally block down there to try catching/closing the
> wayward connection.
>
>
> -Original Message-
> From: Josh Gooding [mailto:josh.good...@gmail.com]
> Sent: Friday, October 30, 2009 1:43 PM
> To: T
: 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(Re
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.)
O
-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 is
-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
-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
> ConnectionPool.getConnection().createStatement().executeQuery(
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
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:
WEB-INF/web.xml
My ConnectionPool class:
import java.s
Wait a second. What I am seeing from you Filip and what I have in my
context.xml are similar:
WEB-INF/web.xml
My ConnectionPool class:
import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.InitialContext;
import javax.servlet.ServletContextEvent;
import
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 be
look at jdbc-pool.html it has all the info, here are examples out of it
Configuration
Code:
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.tomcat.jdbc.pool.DataSource;
import org.apache.tomcat.jdbc.pool.
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 Goodingwrote:
AHHH
-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
f
-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
Hey what API holds the statementFinalizer?
On Fri, Oct 30, 2009 at 9:57 AM, Josh Gooding wrote:
> 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.
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 wrote:
> hi Josh, calling Connection.close() does not close statements and
> resultsets.
> There is an interceptor you can c
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
accor
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 Connectio
-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 m
52 matches
Mail list logo