Documentation for Objectify 6.1.3 features

63 views
Skip to first unread message

Anders Corlin

unread,
Jan 21, 2025, 4:48:02 PMJan 21
to objectify-appengine
Hi!

Cool that new features are being added!!

I couldn't find any documentation on the new features in 6.1.3, so I tried a bit on my own, with not so much success.

  • PITR / readTime - I get "The requested 'read_time' is too old." which ever time I try, for example "2025-01-19 00:00".
  • explain - I just get an empty iterator sequence for a query on a kind and filtered on the modifiedAt field > a time.
  • Is there a use case for ReadOnly transactions also without readTime attribute?

// Anders

Jeff Schnitzer

unread,
Jan 21, 2025, 4:54:31 PMJan 21
to objectify...@googlegroups.com
I confess that I don't know a lot about how this works under the covers; Objectify is just calling into Google's low level APIs.

For explain, look for the QueryResults.getExplainMetrics() method.

ReadOnly transactions are supposed to be optimized. They won't experience concurrency issues that trigger retries, which might make logic easier if you're doing multiple things in the txn block.

Jeff

--
You received this message because you are subscribed to the Google Groups "objectify-appengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appen...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/objectify-appengine/4912489a-3c99-4051-afa2-386a06ca3fd8n%40googlegroups.com.

Anders Corlin

unread,
Jan 21, 2025, 6:29:38 PMJan 21
to objectify-appengine
Thanks for prompt response Jeff!

QueryResults.getExplainMetrics() is implemented as:
default Optional<ExplainMetrics> getExplainMetrics() {
   throw new UnsupportedOperationException("Not implemented.");
}

I was trying QueryExecute.explain() but I just get an empty response back.

So if anyone has some examples how to use explain() and readTime(), it would be great!

Anders

Jeff Schnitzer

unread,
Jan 22, 2025, 11:49:36 AMJan 22
to objectify...@googlegroups.com
Sorry if this is a dumb question, but did you try it? That's just the default impl on the interface (so that it doesn't break backwards compatibility). I would expect the concrete impl that gets returned from google's library to override that. Make sure you have the latest google library (the version referenced from ofy 6.1.3 should be fine).

Jeff

Anders Corlin

unread,
Jan 22, 2025, 6:57:45 PMJan 22
to objectify-appengine
Of course Jeff, you're right!

However, calling getExplainMetrics() also just returns an empty optional for all my queries, so still not much wiser how to use the feature.

Jeff Schnitzer

unread,
Jan 22, 2025, 7:09:46 PMJan 22
to objectify...@googlegroups.com
Unfortunately the innards of Google are just as mysterious to me :-(

Are you trying this against the real datastore or against the emulator? I would be surprised if this has been implemented in the emulator.

Jeff

Anders Corlin

unread,
Jan 22, 2025, 7:12:06 PMJan 22
to objectify-appengine
> Unfortunately the innards of Google are just as mysterious to me :-(
😎😎

I only use the real one.
Reply all
Reply to author
Forward
0 new messages