mysql-native v2.1.0
Bauss
jj_1337 at live.dk
Thu Mar 8 07:14:22 UTC 2018
On Thursday, 8 March 2018 at 07:03:15 UTC, Nick Sabalausky
(Abscissa) wrote:
> On 03/07/2018 04:53 PM, bauss wrote:
>>
>> I can't seem to reproduce it now, but I'll keep an eye for it
>> and see if it still happens, but I think the problem is when
>> you return the connection from a function.
>>
>> I had similar issues returning a raw connection created.
>
> By any chance, are you ever storing a Connection or a
> ResultRange anywhere? I don't mean as a function-local variable
> or a a function parameter: I mean like as a class/struct member
> or as a global? (Well, not that D really has true globals, but
> a "global" at the module-level.)
>
> If you keep around a Connection (or a ResultRange, which has a
> reference to its own Connection) past the end of the vibe.d
> task that was using it, then that can definitely cause this
> kind of problem.
>
> (AIUI, vibe.d wants to make the connections you obtain from a
> pool be Scoped. That would help prevent users from accidentally
> storing something they shouldn't and running into this issue.)
Yeah I stores the result range which I assume was the issue, but
I'm returning results as arrays now so it probably solved it.
That behavior should be documented though, I don't recall reading
that anywhere and it's kind of a gotcha
More information about the Digitalmars-d-announce
mailing list