Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
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
Show 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 {
...
@@ -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.
// wrongClassError is the error cause returned when ZODB object's class is not what was expected.
type
wrongClassError
struct
{
type
wrongClassError
struct
{
want
,
have
string
want
,
have
string
...
@@ -239,6 +245,14 @@ func (conn *Connection) checkTxnCtx(ctx context.Context, who 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 .
// checkTxn asserts that specified "current" transaction is the same as conn.txn .
func
(
conn
*
Connection
)
checkTxn
(
txn
transaction
.
Transaction
,
who
string
)
{
func
(
conn
*
Connection
)
checkTxn
(
txn
transaction
.
Transaction
,
who
string
)
{
if
txn
!=
conn
.
txn
{
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