StackOverflowError when calling repository method [DATAMONGO-2465] #3320
Labels
in: mapping
Mapping and conversion infrastructure
in: repository
Repositories abstraction
status: declined
A suggestion or change that we don't feel we should currently apply
type: bug
A general bug
Eduard Onofrei opened DATAMONGO-2465 and commented
I am getting a StackOverflowError when calling a method of my MongoDB repository interface:
apis
is a list with just one DBRef: new DBRef("api", new ObjectId("5e3ad9faaafa595898b6a682"))searchKeyword
equals "accounts"pageable
is{{Page request [number: 0, size 37, sort: UNSORTED]
}}. Ifsize
is 36, it doesn't throw theStackOverflowError
!The query gets translated into
-Xss1G
(it's a lot, I know), and it just keeps filling the stack slowly and won't return. If I rerun the test with a page size of 36, it returns immediately.Does anyone have a clue what's happening?
The Term:
The stacktrace: https://pastebin.com/y0XYt7p6
Although there might be a circular reference because
Term
has an attributeMap<String, Term>
, I think it's not a circular reference what is producing the stack overflow.Doing some debug, I saw that the stack overflow occurs because in the end,
spring-data
keeps instantiating thisTerm
only (not others, so I don't see the circular reference):Which in turn does not reference other terms.
Here is another
Term
, just for comparison:I see no difference, but
debitCurrency
produces the stack overflow anddisplayCardNumber
doesn'tAffects: 2.2.4 (Moore SR4)
Reference URL: https://stackoverflow.com/questions/60082035/stackoverflowerror-when-calling-spring-data-mongodb-repository-method-with-a-pag
Attachments:
The text was updated successfully, but these errors were encountered: