Subject RE: [Firebird-Java] How is statement pooling working ?
Author Rick DeBay
I think I want you to correct it too :-)
When a statement is closed, its wrapper should reset all its properties,
parameters, and resultsets, and return it to the pool. When the
connection is closed, it gets returned to a pool also, and shouldn't
have its statement pool reset.
Of course if you have a dozen connections in the pool it's a crap-shoot
whether you'll get a connection that has your statement in its pool, but
eventually the caches reach a steady-state.

Rick DeBay

-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Thursday, August 05, 2004 9:15 AM
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] How is statement pooling working ?

> my question:
> Is the PreparedStatement in the following code somehow reused ?
> while(true) {
> Connection con = getConnection(); // gets a connection from Pool.
> PreparedStatement ps = con.prepareStatement(some_sql);
> ps.execute();
> con close();
> }

No, when you close the connection, prepared statement pool is
released...
Hmmm... I think I want to correct this.

Roman





Yahoo! Groups Links