Well, I managed get the delegate driver to set up properly, but connection pooling is still giving me a lot of trouble.
From the descriptions given in the documentation, it appears that connection pooling should work like this:
- Set up the DBXPool driver delegate on a single, global Connection object
- Use this Connection object for all calls into the database
- Each DB call will get automagically routed through the delegate driver into a connection that's unique to its thread, owned by the connection pool.
In practice, I'm finding that everything seems to still be handled by the global Connection object, leading to all sorts of strange race conditions and crashes when I try to run DB queries from multiple concurrent threads.
In case it's relevant, I don't have many DBX-specific components defined; I generally run queries by calling the Connection.Execute
method.
Any idea what I'm doing wrong? Am I missing a step somewhere, or do I have a bad understanding of how the DBXPool delegate driver works?