A
Andy
I've been thinking about using command.Prepare() to prepare the execution of
some of the statements that I run repeatedly in the database. We have run
into situations where prepared statements have drastically improved
performance, especially against Oracle.
One of the issues with calling Command.Prepare is that the prepared
statement is then affinitized to the Connection that it was prepared on,
correct?
If that is true, how can it be possible to use Command.Prepare and also to
release connections back to the pool immediately as per ADO.Net best
practices? How could I possibly use the command again as there is no way to
associate the Command with the actual connection which has been released
back to the pool?
Is it then true that there is no way to use prepared statements and
connection pooling together in an application?
I would appreciate any insight from anyone else who has tried this. It looks
to me like the only way this can happen is to write your own connection
pool.
Regards,
Andrew Elmhorst
some of the statements that I run repeatedly in the database. We have run
into situations where prepared statements have drastically improved
performance, especially against Oracle.
One of the issues with calling Command.Prepare is that the prepared
statement is then affinitized to the Connection that it was prepared on,
correct?
If that is true, how can it be possible to use Command.Prepare and also to
release connections back to the pool immediately as per ADO.Net best
practices? How could I possibly use the command again as there is no way to
associate the Command with the actual connection which has been released
back to the pool?
Is it then true that there is no way to use prepared statements and
connection pooling together in an application?
I would appreciate any insight from anyone else who has tried this. It looks
to me like the only way this can happen is to write your own connection
pool.
Regards,
Andrew Elmhorst