Stopping the Memory Leak: Implementing Server-Side Pagination in Grails GORM
Stop OutOfMemoryErrors in Grails by moving pagination from the JVM to the database. Learn how to use GORM's paginate method and PagedResult for efficient data retrieval.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop OutOfMemoryErrors in Grails by moving pagination from the JVM to the database. Learn how to use GORM's paginate method and PagedResult for efficient data retrieval.
In a Grails 4.x application, a service method marked with @Transactional performs a simple read‑then‑write operation on a domain class using GORM. The method is invoked via a controller endpoint that is accessed by a load generator simulating multiple concurrent users. When the endpoint is called with a single request, response times remain within expected b
In Grails controller actions, data binding validation can throw a BindException when the submitted payload fails constraint checks. The exception packages field-level errors through the errors property, typically accessed via errors.getFieldErrors(). This mechanism surfaces missing or invalid fields but whose exact structure and error codes vary across Grail
Goal Determine whether nested association binding (e.g., author.name ) should be permitted for a given request endpoint, given that Grails enables deep binding by default. Constraints and Uncertainty The bindable static constraint acts as an allowlist/blocklist for top‑level properties but its effect on nested property paths is not explicitly documented for
I have a Grails application where the development environment uses dbCreate: update , so Hibernate builds and evolves the schema automatically while running locally. For the production environment, the documented guidance is effectively to avoid auto-generation, which leaves an open decision about how the production schema should actually be created and kept
We are moving a Grails 5 application from the executable JAR to a WAR deployed on an external Tomcat, and a recent deployment failed silently: the application log showed only a wrapped BeanCreationException and then nothing, leaving us unsure where the root cause went. In the executable JAR mode, the failure was visible in stdout with a full stack trace. Und
Goal Configure the Grails Spring Security Core plugin so that a user account with passwordExpired = true is sent to an application-defined password-change controller immediately after authentication, rather than to the default target URL. Constraints The core plugin does not supply a mandatory post-login redirect or password-change controller. Expired creden
Context A Grails 6 application must support production schema changes that can be rolled back reliably within a defined maintenance window. The team currently uses dbCreate: "update" in development but recognizes it provides no rollback mechanism for failed deployments. Trade-off The grails-database-migration plugin (Liquibase) offers explicit rollback via d
Goal Determine how to cancel asynchronous work when a Grails transaction exceeds its configured timeout. Context Grails applies Spring’s @Transactional(timeout=N) or grails.transaction.defaultTimeout to database operations. When the timeout is hit, Spring throws a org.springframework.transaction.TransactionSystemException , which Grails wraps into a runtime