playframework / playframework/play-ebean

Ebean generating too many queries

Open
#355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
111
Forks
67
Avg merge
1d 11h
Merged PRs (30d)
19

Description

Using Play 2.7 and Ebean plugin version 5.0.2.

Ebean is generating me 10s of transactions ending like this.

....
where t0.id = any(Array[10]={230430,230431,230432,230433,230434,230435,230436,230437,230438,230439});
where t0.id = any(Array[10]={230440,230441,230442,230443,230444,230445,230446,230447,230448,230449});
where t0.id = any(Array[10]={230450,230451,230452,230453,230454,230455,230456,230457,230458,230459});
where t0.id = any(Array[10]={230460,230461,230462,230463,230464,230465,230466,230467,230468,230469});
where t0.id = any(Array[10]={230470,230471,230472,230473,230474,230475,230476,230477,230478,230479});
...

I have set up configuration like following, but still batch size 10 items as one transaction. Do I need to configure something else?

public class EbeanStartupConfig implements ServerConfigStartup {
	public void onStart(ServerConfig serverConfig) {
		serverConfig.setQueryBatchSize(100);
		serverConfig.setLazyLoadBatchSize(100);
	}
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EbeanStartupConfig.onStart example and trace how ServerConfig.setQueryBatchSize(100) and setLazyLoadBatchSize(100) are applied. Reproduce the reported batching with Play 2.7 and Ebean plugin 5.0.2, then identify why batches remain at 10. Done means the configured batch size is honored or the configuration requirement is clearly documented, with a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.