Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Cache failed for pointer array #894

Open
sleagon opened this issue Apr 16, 2018 · 1 comment
Open

Cache failed for pointer array #894

sleagon opened this issue Apr 16, 2018 · 1 comment
Labels
Milestone

Comments

@sleagon
Copy link

sleagon commented Apr 16, 2018

// cache failed
games := make([]*Game, 0) // pointer array
session.Find(&games)

// cache hit
games := make([]Game, 0) // struct array
session.Find(&games)

reason:

if bean == nil || reflect.ValueOf(bean).Elem().Type() != ckt {
    // ...
}
sleagon added a commit to sleagon/xorm that referenced this issue Apr 16, 2018
@sleagon
Copy link
Author

sleagon commented Apr 16, 2018

I am not sure this pattern is designed to workaround the cache or just an issue. When we need to workaround the cache, we may write our code as shown upside. Anyway, PR #895 is provided.

@lunny lunny added the kind/bug label Apr 16, 2018
@lunny lunny added this to the 0.7 milestone Apr 16, 2018
@lunny lunny modified the milestones: 0.7, 0.8 May 4, 2018
@lunny lunny modified the milestones: 0.8, 0.8.1 Jan 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants