Reputation: 22173
I'm trying to use Objectify in my App Engine project. It works but I've got several "paths" where a single entity can be read and write by a single servlet. Now if I well understood the architecture, according to the load the servlet container can instantiate my servlet multiple times, isn't it? So the question is: do I need to use Objectify transactions in this case? My doubt is quite basic because I think this kind of situation happens 99% of times in this context, so at this point the other question is: when I can use the simple objectify load and save? I hope someone can clarify a bit.
Upvotes: 0
Views: 620
Reputation: 306
From Objectify Wiki: If you operate on the datastore without an explicit transaction, each datastore operation is treated like a separate little transaction which is retried separately (link: https://github.com/objectify/objectify/wiki/Concepts#transactionless).
So all the save()
or delete()
are executed in separate transaction. So it doesn't matter even if GAE starts multiple instances of your Servlet.
You would want to start a transaction explicitly, when you want to perform multiple operations as an atomic transaction (either all or none). e.g. select and modify, or modify multiple objects together....
Upvotes: 1