You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have a question abort txn.Insert() function. it has a describe “Modifying values in-place that are already inserted into MemDB is not supported behavior.”
` // Create a new data base
db, err := memdb.NewMemDB(schema)
if err != nil {
panic(err)
}
txn := db.Txn(true)
p := Person{"[email protected]", "Joe", 30}
if err := txn.Insert("person", p); err != nil {
panic(err)
}
txn.Commit()
txn = db.Txn(false)
defer txn.Abort()
p.Name = "Janeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
p.Age = 1111111
p.Email = "[email protected]"
// List all the people
it, err := txn.Get("person", "id")
if err != nil {
panic(err)
}
for obj := it.Next(); obj != nil; obj = it.Next() {
x := obj.(Person)
fmt.Printf(" %+v\n", x)
}
`
aftern Insert and commit, i change object'value
and result is : &{Email:[email protected] Name:Janeeeeeeeeeeeeeeeeeeeeeeeeeeeeee Age:1111111}
is that correctly?
The text was updated successfully, but these errors were encountered:
i have a question abort txn.Insert() function. it has a describe “Modifying values in-place that are already inserted into MemDB is not supported behavior.”
` // Create a new data base
db, err := memdb.NewMemDB(schema)
if err != nil {
panic(err)
}
txn := db.Txn(true)
p := Person{"[email protected]", "Joe", 30}
if err := txn.Insert("person", p); err != nil {
panic(err)
}
txn.Commit()
`
aftern Insert and commit, i change object'value
and result is : &{Email:[email protected] Name:Janeeeeeeeeeeeeeeeeeeeeeeeeeeeeee Age:1111111}
is that correctly?
The text was updated successfully, but these errors were encountered: