eahrold opened a new issue, #14499:
URL: https://github.com/apache/grails-core/issues/14499
### Task List
- [x] Steps to reproduce provided
- [x] Stacktrace (if present) provided
- [x] Example that reproduces the problem uploaded to Github
- [x] Full description of the issue provided (see below)
When trying to retrieve a user using an entity's first method (i.e
`Person.first()`), the first result is returned disregarding tenant. This is
the case even when `Tenants.currentId()` has the correct setting. As a work
around I've been using `Person.findByTenantId(Tenants.currentId())` to get the
expected result.
### Steps to Reproduce
1. Create `Person MultiTenanty<T>` Domain
2. Create `@Service(Person)` Service class with `@CurrentTenant`
3. Implement a method in the service that calls `Person.first()`
4. Create Two users under two different tenants.
5. Try and retrieve the first user from each tenant using
`PersonService:first` with the respective tenantId
6. Same user is returned for each
### Expected Behaviour
`Entity.first()` should pull the first of a given tenant
### Actual Behaviour
`Entity.first()` return the first in the DB ignoring tenant
### Environment Information
- **Operating System**: MacOS
- **GORM Version:** 7.1.0M2
- **JDK Version:** TODO 8
### Example Application
- TODO: link to github repository with example that reproduces the issue
https://github.com/eahrold/gorm-broken-tenancy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]