In my app, I have a pretty generic relationship between two tables:
TABLES:
Stuff
- StuffID
- Name
- PersonID
- …
Person- PersonID- Name
- …
Based on this, I want to do a list():
c = StuffService.newCriteria();
c.createAlias( ‘Person’, ‘p’ ).isEq( ‘p.PersonID’, someid ).list()
This works fine…most of the time. The other day, however, I ran a script to update some PersonIDs on the Stuff table.
I can’t confirm that this created the issue, but after I did this I started getting the following error when running the criteria query:
Object with id: ‘blahblahblah’ was not of the specified subclass: Person (loaded object was of wrong class class coldfusion.orm.PersistentTemplateProxy)
I can’t replicate this in my dev environment, so I can’t confirm that the two are precisely related. However, I had never seen this error until I made that data update.
I can seem to fix it for a while with an ORMReload(). However, after a while it seems to come back again (presumably because I updated records that aren’t interacted with until a future time?).
If this sounds confusing, most of it is probably because I’m horribly confused about what’s going on, what I should do to fix it, if it can be fixed, etc.
Does anyone have any thoughts on this issue?
NOTE: I have seen this rather lengthy thread: https://groups.google.com/forum/?fromgroups#!topic/cf-orm-dev/f3Dj-2kFoIk
While it describes the error I’m getting, there doesn’t seem to be the exact same conditions, AND (worst of all) there are no real conclusions that I can see.
I appreciate any help anyone can give.
Thanks!