Hi
It seems that ORM (Hibernate) is caching my queries when it’s doing entity loading.
For example if I try to load the following entity (userService.get(“xxx”)):
component persistent=“true” entityname=“User” table=“users” output=“false” {
property name=“id” column=“username” fieldtype=“id”;
property name=“location”
fieldtype=“many-to-one”
cfc=“Location”
fkcolumn=“location_id123”; // deliberate mistake
public User function init() output=“false” {
return this;
}
}
I’ll first get a SQL error “[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name ‘location_id123’.”, which is fine, since the correct column name should be location_id.
But if I change the fkcolumn to location_id, I continue to get the exact same error ([Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name ‘location_id123’.), which indicates that the query is cached.
This is my ormSettings in Application.cfc:
this.ormSettings = {
// Location of your entities, default is your convention model folder
cfclocation = ["./model/entities"],
// Choose if you want ORM to create the database for you or not?
dbcreate = “none”,
// Log SQL or not
logSQL = true,
// Don’t flush at end of requests, let Active Entity manage it for you
flushAtRequestEnd = false,
// Don’t manage session, let Active Entity manage it for you
autoManageSession = false,
// Active ORM events
eventHandling = true,
// Use the ColdBox WireBox Handler for events
eventHandler = “coldbox.system.orm.hibernate.WBEventHandler”,
secondaryCacheEnabled = false,
flushatrequestend = true
};
Any idea what else should I try?
Thanks!