Skip to content

Add a bug check for incorrect concurrently use #2459

@iseki0

Description

@iseki0

Is your feature request related to a problem? Please describe.
Of course, we shouldn't use a single session(aka. connection) in multi threads(goroutines) without lock.
But there's still a chance that someone might shoot themselves in the foot. In that cases, we might got a simple and unclear message: "bad connection". It's not good, right?

Describe the solution you'd like
Maybe we can add a bugcheck, if someone do the unclever things, let them know.

Additional context
The pesudo-code

_:=conn.BeginTx() // begin a transaction
for i:=0;i <10; i++ {
    go func(){
        for {
            conn.Query(...) // boom!
        }
    }()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions