Subject Re: Can I cache prepared statements in my own pool?
Author fedd_kraft
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
> Prepared statements belong to the connection. You cannot prepare
statement

Oh I knew it was like that :(

> in one connection and use with another. So, you can create your own
pool of
> statements, but it must also pool connections. But in this case just
use the
> FBWrappingDataSource or FBConnectionPoolDataSource - that is what
you want
> to implement.

I want to gain advantage of that I have 'finite' (in
Russian, 'konechnoe') quantity of possible statements in my
application, for example, 15. If preparings cost 10 - 40 ms, why not
to do it beforehand. But I also use a (built-in) connection pool.

So should I prepare 15x10 (pool size) statements and keep them in an
object that holds pooling data source also? Or there is some mechanizm
automating that?

And how much is memory price of prepared statement keeping?

F.