Skip to content

Commit

Permalink
fix: disable union for batch get by default. (#89)
Browse files Browse the repository at this point in the history
We had a user report that while this increased performance for them, it also caused a stack overflow error.

See https://groups.google.com/g/ebean/c/ILpii41dJPA/m/VxMbPlqEBwAJ for more details.
  • Loading branch information
John Plaisted authored Mar 30, 2021
1 parent a6b55f3 commit 3605edd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class EbeanLocalDAO<ASPECT_UNION extends UnionTemplate, URN extends Urn>
private int _queryKeysCount = 0; // 0 means no pagination on keys

// TODO feature flag, remove when vetted.
private boolean _useUnionForBatch = true;
private boolean _useUnionForBatch = false;

@Value
static class GMAIndexPair {
Expand Down Expand Up @@ -167,6 +167,9 @@ public EbeanLocalDAO(@Nonnull BaseMetadataEventProducer producer, @Nonnull Serve
* vetted this in production we will be removing this flag and making the the default behavior. So if you set this
* to true by calling this method, your code will break when we remove this method. Just wait a bit for us to turn
* it on by default!
*
* <p>While this can increase performance, it can also cause a stack overflow error if {@link #setQueryKeysCount(int)}
* is either not set or set too high. See https://groups.google.com/g/ebean/c/ILpii41dJPA/m/VxMbPlqEBwAJ.
*/
public void setUseUnionForBatch(boolean useUnionForBatch) {
_useUnionForBatch = useUnionForBatch;
Expand Down

0 comments on commit 3605edd

Please sign in to comment.