Commit c13c3068 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 82746330
......@@ -118,6 +118,16 @@ type LiveCacheControl interface {
// ----------------------------------------
// newConnection creates new Connection associated with db.
func newConnection(db *DB, at Tid) *Connection {
return &Connection{
stor: db.stor,
db: db,
at: at,
objtab: make(map[Oid]*weak.Ref),
}
}
// wrongClassError is the error cause returned when ZODB object's class is not what was expected.
type wrongClassError struct {
want, have string
......
......@@ -135,7 +135,7 @@ func (db *DB) get(at Tid) *Connection {
// nothing found or too distant
const Tnear = 10*time.Minute // XXX hardcoded
if jδmin < 0 || tabs(δtid(at, db.connv[jδmin].at)) > Tnear {
return &Connection{stor: db.stor, db: db, at: at}
return newConnection(db, at)
}
// reuse the connection
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment