I need to implement a connection pooling mechanism for a .Net 4.5 web application that uses Cassandra and cassandra-sharp for data storage and data access respectively. I can see two standard options (ignoring Spring.Net for now):
So:
- What would you recommend? System.Data seems like a pain and a bit of a black box but COM+ seems legacy? Would Spring.Net object pooling be a better option?
- If I implement System.Data and use connection strings do I just work out which classes I need to implement by following the properties and methods in DbConnection? Or are there more setup stages eg special connection strings.
- I need to ensure that there's strictly only ever a single reused connection in the pool and that it's capable of being accessed asynchronously. Is that a connection string setting for System.Data and is asynchronous access even possible with either approach?
- There are large parts of System.Data that are relevant only to relational databases eg transactions. Which is least likely to break pooling when implementing not supported methods and properties: throwing a NotSupportedException or stubbing them?