Subject Re: [Firebird-Java] How is statement pooling working ? (2nd try)
Author Roman Rokytskyy
> But i could simply use
> Connection con = getConnection(); // gets a connection from Pool.
> PreparedStatement ps = con.prepareStatement(some_sql);
> while(true) {
> ps.setInt(1,1);
> ps.execute();
> }
> con close();
> to achieve the same, or not ?

In your example - yes.

However I used it in a bit different scenario. I had a method that returned
the current connection for the current thread for the current transaction
(simple thread-local variable). Then different database-aware components
were obtaining the connection but _never_ closed it (it was shared among
them). There was a central method to commit the transaction which basically
called commit() and close(). In that scenario it worked ok.

BTW, this is how EJB applications work, but usually J2EE servers do not need
JayBird statement pooling, since they have their own.

> I hope you will release 1.5 and 1.5.1 soon ;)

I hope that too. If there is no bug reports till end of next week, I will
release the 1.5.0. Then 1.5.1 will follow.