3622Re: [xml-dbms] Reusing Connections
- Dec 2, 2004It reuses the connection. That is, the Transfer object holds the
connection open and does not return it to the pool.
The reason for this is so it can reuse prepared statements. If it
returns the connection to the pool and then gets a new connection from
the pool later, there is no guarantee that the new connection will have
the prepared statements it needs.
(If anybody can explain how prepared statements are supposed to work
with pooled connections, I'd be happy to listen. What I've just
described strikes me as wrong, but I can see no way around it. That is,
I'd like to prepare my statements, leave them in a prepared state, but
return the connection to the pool while I am not using it.)
> If I call storeDocument(...) more than one time on a Transfer object myTransfer,
> does myTransfer.storeDocument(...) reuse the connection, making a new connection
> to the database or is he using a connection pool?
- << Previous post in topic