Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why set autocommit(0) when connection is still in unautocommit status?? #599

Open
pingworld opened this issue Jan 27, 2021 · 1 comment
Open

Comments

@pingworld
Copy link

if !c.isAutoCommit() {

if !c.isAutoCommit() { // not in autocommit ??  
    // then set it again ??  
    if err = co.SetAutoCommit(0); err != nil {  
	    return  
    }  
  } else {  
    // do transaction ??  
    if err = co.Begin(); err != nil {  
	    return  
    }  
}  

thanks for your response.

@fenngwd
Copy link

fenngwd commented Feb 7, 2021

isAutoCommit is check whether need to set autocommit.
When isAutoCommit return false, it need to SetAutoCommit(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants