qedus / nds

A Go (golang) Google App Engine datastore package with strongly consistent caching.
http://godoc.org/github.com/qedus/nds
Apache License 2.0
147 stars 27 forks source link

Change locking policy for Transaction #68

Open someone1 opened 5 years ago

someone1 commented 5 years ago

This was driving me up a wall, but nds treats transactions differently than the datastore package.

Specifically, it keeps an internal lock which is never unlocked after a commit or rollback. This will keep executing code deadlocked and is different than how the datastore package handles things.

Comments around this specify:

// tx.Unlock() is not called as the tx context should never be called
// again so we rather block than allow people to misuse the context.

Should we reconsider this policy or better document the difference in behavior from the datastore package?

jongillham commented 5 years ago

Are you talking about v2? If so are you allowed to try committing a transaction again if it fails? Being able to match the datastore would be ideal.