fix bug
This commit is contained in:
parent
67d07d9d3e
commit
899887b243
4
pool.go
4
pool.go
|
@ -21,13 +21,13 @@ var ConnectionNum int32 = 0
|
||||||
func (p NoneConnectPool) RetrieveDB(engine *Engine) (db *sql.DB, err error) {
|
func (p NoneConnectPool) RetrieveDB(engine *Engine) (db *sql.DB, err error) {
|
||||||
atomic.AddInt32(&ConnectionNum, 1)
|
atomic.AddInt32(&ConnectionNum, 1)
|
||||||
db, err = engine.OpenDB()
|
db, err = engine.OpenDB()
|
||||||
fmt.Printf("--open a connection--%x\n", &db)
|
//fmt.Printf("--open a connection--%x\n", &db)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p NoneConnectPool) ReleaseDB(engine *Engine, db *sql.DB) {
|
func (p NoneConnectPool) ReleaseDB(engine *Engine, db *sql.DB) {
|
||||||
atomic.AddInt32(&ConnectionNum, -1)
|
atomic.AddInt32(&ConnectionNum, -1)
|
||||||
fmt.Printf("--close a connection--%x\n", &db)
|
//fmt.Printf("--close a connection--%x\n", &db)
|
||||||
db.Close()
|
db.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue