Whatever message this page gives is out now! Go check it out!

ORM Function enhancements

Last update:
Jun 9, 2026
Web Application Platforms
Ask AI
Search
Web Application Platforms
Whatever message this page gives is out now! Go check it out!
ColdFusion
  1. Home
  2. Adobe ColdFusion User Guides
  3. ORM Function enhancements
Copy page
Last update:
May 18, 2026
Multiple data source support impacts the following ORM functions:

ORMGetSession

Description

Returns the Hibernate session associated with the data source in the request. If ORM is not configured for this data source, it results in an exception. If data source is not specified, the Hibernate session of the default data source is returned. Use this session object to call the APIs, which, otherwise, ColdFusion does not expose. For information on session APIs, see:

Function syntax

ormgetsession([datasource])

ORMCloseSession

Description

Closes the Hibernate session associated with the data source in the request. If you do not specify a data source, the Hibernate session associated with the default data source is closed.

Function syntax

ormcloseallsessions()

ORMCloseAllSessions

Description

Closes all Hibernate sessions in the request.

Function Syntax

ormcloseallsessions()

History

ColdFusion 9 Update 1: Added this function

ORMFlush

Description

Flushes the Hibernate session associated with the data source in the request. ORMFlush flushes all pending CRUD operations in the request. Any changes made in the objects, in the current ORM session, are saved to the database. If you do not specify the data source, the Hibernate session associated with the default data source is flushed.

Function syntax

ormflush([datasource])

ORMFlushall

Description

Flushes all the current Hibernate sessions in the request.

Function syntax

ormflushall()

History

ColdFusion 9 Update 1: Added this function

ORMClearSession

Description

Clears the Hibernate session associated with the given data source.The function clears the first level cache and removes the objects that are not yet saved to the database.If you do not specify the data source, the Hibernate session associated with the default data source is cleared.

Function syntax

Ormclearsession([datasource])

ORMGetSessionFactory

Description

Returns the Hibernate Session Factory object associated with the data source. Results in an error if ORM is not configured for this data source. If you do not specify the data source, the Hibernate session factory object associated with the default data source is returned. For information on Session API, go to the following URL:

Function syntax

Ormgetsessionfactory([datasource])

ORMEvictQueries

Description

This method is used to evict the data of all the queries from the default query cache of the specified data source. If cache name is specified, then the data of all queries belonging to the cache region with the given cache name are evicted.If no data source is specified, the default query cache of the default data source is evicted.

Syntax

{
{ORMEvictQueries([cachename])
ORMEvictQueries([cachename], datasource)}}
ParameterDescription
cachenameName of the cache region that you want to evict.
datasourceName of the data source whose cache you want to evict. If you do not specify the cache, the default query cache is evicted.

ORMExecuteQuery

Description

Executes a Hibernate Query Language (HQL) query.By default, this function works on ORM's default data source. To use this function for another data source, specify the data source key-value pair within the queryoptions.

Syntax

{
{ORMExecuteQuery(hql, [params] [,unique])
ORMExecuteQuery(hql, [,unique] [, queryoptions])
ORMExecuteQuery(hql, params [,unique] [,queryOptions])}}

Parameters

ParameterDescription
HqlThe HQL query that has to be executed.
ParamsObject parameter for the entity.
UniqueSpecifies if the object parameter is unique.
QueryoptionsKey-value pair of options for the query.

Example

<cfset artistArr = ORMExecuteQuery("from Artists where artistid=1", true, {datasource="cfartgallery"})> 

<cfset countArray = ORMExecuteQuery("select count(*) from Authors", \[], false, {datasource="cfbookclub"})>
Share this page
Was this page helpful?
Yes, thanks
Not really
We're glad. Tell us how this page helped.
Found the answer to my problem
Understood the instructions
Liked the feature
Other suggestions
Skip
Submit
We're sorry. Can you tell us what didn't work for you?
Didn't find the answer to my problem
Couldn't understand the instructions
Didn't like the feature
Other suggestions
Skip
Submit
Thank you for your feedback. Your response will help improve this page.
Was this helpful?YesNo We are sorry the content didn't meet your needs.Share additional feedback to help us improve.0/255|Character limit exceeded.SubmitSkipThank you so much for sharing your feedback!

On this page

Register for Adobe ColdFusion Summit 2026
AI TRAINING
Build ColdFusion AI workflows
ColdFusion
Support
Resources
Adobe Account
Adobe
Featured products
Copyright © 2026 Adobe. All rights reserved.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page