Make e a class variable. Then all methods can see it.
Recommendation: Change the name to a meaningful one vs a single letter.
Type: Posts; User: Norm
Make e a class variable. Then all methods can see it.
Recommendation: Change the name to a meaningful one vs a single letter.
Yes every time you define a variable in its own scope, a new object will be created.
If the e.commit() call uses a different object than the one with the data, then the data won't be there.
The...
You need to move the definition of e to put it in scope for the savePosition() method.