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

  • Re: mysql-native v2.... bauss via Digitalmars-d-announce
    • Re: mysql-nativ... bauss via Digitalmars-d-announce
      • Re: mysql-n... bauss via Digitalmars-d-announce
        • Re: mys... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
          • Re:... bauss via Digitalmars-d-announce
            • ... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
    • Re: mysql-nativ... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
      • Re: mysql-n... bauss via Digitalmars-d-announce
        • Re: mys... bauss via Digitalmars-d-announce
          • Re:... Nick Sabalausky (Abscissa) via Digitalmars-d-announce
            • ... Bauss via Digitalmars-d-announce
              • ... Nick Sabalausky (Abscissa) via Digitalmars-d-announce

Reply via email to