bah.database and threads

BlitzMax Modules Forums/Brucey's Modules/bah.database and threads

Has anyone tried asynchronus updates...

Heh... not yet.

All the objects are reasonably separated, so for instance, you should, in theory, be able two TDatabaseQuery object running concurrently.

However, the native connection may not like this. I know for a fact that the Oracle JDBC driver (as an example) does not support asynchronous requests on the same connection - it works, but only one at a time.

The error reporting stuff in DBConnection is not thread-safe : meaning, Thread A could populate it, and Thread B could clear it before your code in Thread A can check the status.

Of course, I don't see any reason why you couldn't run multiple DBConnections. It would make more sense anyway (rather than trying to share a single connection), and is more likely to be supported by the native database drivers.
This way, you might want to have some kind of connection pooling thing going on. Where a thread can request a connection from the pool when required. The pool either hands it a vacant one, or creates a new one.