apache / apache/grails-core

GORM not recognizes executeQuery after domain class reloaded

Open
#14,631 0 comments 0 reactions 0 assignees View on GitHub
relates-to: gorm
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

At runtime, after change in hibernate mapped domain class, I get `String-based queries like [executeQuery] are currently not supported in this implementation of GORM` UnsupportedOperationException

I suppose that during class reloading, the hibernate's gorm implementation is somehow replaced with mongo's implementation.
It happens only when `compile :mongodb:3.0.3` is added to BuildConfig, even though any mongo datastore/domain is not configured. Removal of mongodb plugin solves problem. But I need mongodb in my actual app.

I attached logs with couple of comments what actions I took. [test4.txt](https://github.com/grails/grails-data-mapping/files/677444/test4.txt) If logs are not enough to tackle it, I am able to provide sample app.

My env:
Grails version: 2.5.4
java version "1.8.0_112"
plugins used:
```
plugins {
build(":release:3.1.2",
":rest-client-builder:2.1.1") {
export = false
}
compile ":wslite:0.7.2.0"
compile ":asset-pipeline:2.5.7"
compile ':cookie:1.4'

//runtime ":hibernate:3.6.10.19"
build ":tomcat:7.0.55.3" // or ":tomcat:8.0.22"
runtime ":hibernate:3.6.10.18"
compile ":taggable:1.1.0"
compile ":mongodb:3.0.3"
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the attached test4.txt logs and the reported class-reloading sequence in a Grails 2.5.4 application using hibernate and mongodb:3.0.3. Reproduce the failure where executeQuery becomes unsupported after a mapped domain class reload, then determine whether the behavior remains correct with the MongoDB plugin present but unused.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, mongodb
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.