touchlab-lab / knarch.db

K(otlin)N(ative)A(rchitecture) Database
https://touchlab.co/
Apache License 2.0
90 stars 9 forks source link

Implement connection pool #5

Open kpgalligan opened 6 years ago

kpgalligan commented 6 years ago

The current implementation should work across threads in KN, but is very simplistic. We actually create a mutex lock on the session for transactions, so if you start a transaction, you really need to make sure you end it. Either this process will need very serious testing to ensure the app doesn't result in an eventual deadlock, or pooling needs to be implemented (or something else).

It is definitely a stopgap until we come up with a more robust solution.