Open arski opened 12 years ago
Hmm, I see I can simply create other pools via Registry.DBPOOL2 = ... e.g. But is that OK to do? Will the pool run as properly as the first?
I have the same question. Can I simply assign independent DB pools to model classes?
Right now, there's no concept of having multiple pools (let alone, one per class). The only way to get around it would be to manually switch out the value of Registry.DBPOOL to be the pool you want to use for subsequent queries. Not great - I know - but it would require making some pretty big changes to allow for a different pool per class. I'll add this to the list of feature requests.
But wouldn't changing Registry.DBPOOL at run time affect simultaneously running transactions? I was thinking through another approach: double-importing. Outcome: Will also not work, because other submodules import registry via 'full path'. That will always resolve to the same module instance, even if called from different places.
I'm also quite interested in that idea, on don't think it would be extremely difficult. I'll try to work on that over the next week and make a PR for review.
It's very important features! I need in this too.
Hi again,
I'm pretty sure this is really not possible in the module: I have an app that works with two different databases (for various reasons), but obviously Twistar only allows one Registry.DBPOOL connection.. Is there anything that could be done to increase this number? Or either way, what would you recommend to do in such a scenario?
Thanks again, Martin