JDBC Cache statement per connection -
I know that while using predefined the statement will be cached for use next time, but I have read the documents that Cache per connection is made, I think it means that each connection maintains its cache. That is, connections can not use a cached statement in Connection B, even those two connections are in the same connection pool.
I'm wondering why the connection pool can not manage the cash for everyone in the connection, so the statement can be reused by all connections.
My question: Am I right about this? Or I just misunderstood it. And if I am right, then about my thoughts mentioned above. Can this be implemented in such a way?
A statement handle - usually - is connected to a built-in physical connection (not only in JDBC favor , But also in the database side). When the connection is closed, it has been deleted / stopped. As it is connected to the connection, the handle can not be done with a separate connection, so for the statement cache - if any - per connection is.
Even if it is technically possible, then there may be additional problems (eg privilege leaks if there are different rights of connection, etc.)
Comments
Post a Comment