Things to watch out for in ColdFusion 9 with CF-ORM

后端 未结 4 1939
一个人的身影
一个人的身影 2020-12-12 20:40

What are some of the things you\'ve observed in ColdFusion 9 with CF-ORM (Hibernate) that one should watch out for?

4条回答
  •  暖寄归人
    2020-12-12 20:55

    Add'l recommendations:

    • Turn off ormsettings.flushAtRequestEnd = false to not have auto-flush at the end of the request. Instead use transactions (as of CF9.01, cftransaction flushes session for you transaction completion) around all write transactions (entitySave() or when you edit a persisted entity).
    • Prevent SQL injection by using binded parameters in HQL - unnamed '?' or named ':' notations, to assure type binding by ORM against the field in question (like CFQUERYPARAM does). Prevent SQL injection!
    • CF9.0.1 allows CFQUERY dbtype="hql" to write & output HQL inline. Use CFQUERYPARAM to bind params inline (equivalent to unnamed ? notation in HQL).
    • Use LEFT OUTER JOIN FETCH in HQL to eager fetch relationships.
    • Override add/remove functions on CFCs with bi-directional relationships to assure both sides are set when either is.
    • Turn ormsettings.logsql=true to view derived SQL in the console. Adjust log4j Hibernate settings to further tweak log settings from Hibernate.
    • Join Google Group cf-orm-dev. Bright people there.

提交回复
热议问题