Error target lists can have at most 1664 entries JPA, PostgreSQL and wildfly-datasources-galleon-pack

1,192 views
Skip to first unread message

Adriano Aguiar

unread,
Mar 23, 2024, 8:42:36 AM3/23/24
to WildFly
I'm migrating my jsf project with java 8 to jakarta 10 and as I was using wildfly 23 I decided to change to wildfly-maven-plugin with wildfly-datasources-galleon-pack and so far the MultiTenant database connection, the authentication part, worked, but I'm getting an error when mapping two entities with jpa is giving the following error 'org.postgresql.util.PSQLException: ERROR: target lists can have at most 1664 entries', and I want to see if I need to enter any configuration in wildfly-datasources-galleon-pack

Susanne Jarl

unread,
Mar 24, 2024, 12:33:51 AM3/24/24
to WildFly
Often when you get this message you need to add fetch = FetchType.LAZY on some of your @ManyToOne relations.
@OneToMany and @ManyToMany relations are FetchType.Lazy by default, whereas @ManyToOne and @OneToOne are FetchType.Eager as default. So you need to lower the amount of fetched entries by making some or all of them lazy loaded.

/Susanne

Reply all
Reply to author
Forward
0 new messages