Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
619e2b3c
Commit
619e2b3c
authored
Oct 02, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d3e124d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
go/zodb/connection.go
go/zodb/connection.go
+15
-1
No files found.
go/zodb/connection.go
View file @
619e2b3c
...
...
@@ -130,6 +130,12 @@ func newConnection(db *DB, at Tid) *Connection {
}
}
// At returns database state corresponding to the connection.
func
(
conn
*
Connection
)
At
()
Tid
{
conn
.
checkLive
(
"at"
)
return
conn
.
at
}
// wrongClassError is the error cause returned when ZODB object's class is not what was expected.
type
wrongClassError
struct
{
want
,
have
string
...
...
@@ -239,6 +245,14 @@ func (conn *Connection) checkTxnCtx(ctx context.Context, who string) {
// checkTxn asserts that specified "current" transaction is the same as conn.txn .
func
(
conn
*
Connection
)
checkTxn
(
txn
transaction
.
Transaction
,
who
string
)
{
if
txn
!=
conn
.
txn
{
panic
(
"connection: "
+
who
+
"current transaction is different from connection transaction"
)
panic
(
"connection: "
+
who
+
": current transaction is different from connection transaction"
)
}
}
// checkLive asserts that the connection is alive - the transaction under which
// it has been opened is not yet complete.
func
(
conn
*
Connection
)
checkLive
(
who
string
)
{
if
conn
.
txn
==
nil
{
panic
(
"connection: "
+
who
+
": connection is not live"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment