all entity insertions, in the same order the corresponding objects were saved using EntitySave()
- ColdFusion Developers Guide
- Develop ColdFusion applications
- Introducing ColdFusion
- Changes in ColdFusion
- Changes in ColdFusion
- Replacement of JRun with Tomcat
- Security enhancements
- ColdFusion WebSocket
- Enhanced Java integration
- ColdFusion ORM search for indexing and search
- Solr enhancements
- Scheduler enhancements
- Integration with Microsoft Exchange Server 2010
- RESTful Web Services in ColdFusion
- Lazy loading across client and server in ColdFusion
- Web service enhancements
- Displaying geolocation
- Client-side charting
- Caching enhancements
- Server update using ColdFusion Administrator
- Secure Profile for ColdFusion Administrator
- Introduction to application development
- The CFML programming language
- Building blocks of ColdFusion applications
- Develop CFML applications
- Develop CFML applications
- Design and optimize a ColdFusion application
- Handle errors
- Use persistent data and locking
- Use ColdFusion threads
- Secure applications
- Client-side CFML (for mobile development)
- Use the ColdFusion debugger
- Debugging and Troubleshooting Applications
- Develop globalized applications
- REST enhancements in ColdFusion
- Authentication through OAuth
- Social enhancements
- Develop mobile applications
- Access and use data
- ColdFusion ORM
- ColdFusion and HTML5
- Flex and AIR integration in ColdFusion
- Request and present information
- Office file interoperability
- ColdFusion portlets
- Work with documents, charts, and reports
- Use web elements and external objects
- Use external resources
- Send and receive e-mail
- Interact with Microsoft Exchange servers
- Interact with remote servers
- Manage files on the server
- Use event gateways
- Create custom event gateways
- Use the ColdFusion extensions for Eclipse
- Use the data services messaging event gateway
- Use the data management event gateway
- Use the FMS event gateway
- Use the instant messaging event gateways
- Use the SMS event gateway
Hibernate Session is a thread-safe and short-lived object that represents a conversation between the application and the persistence layer. This is required to perform CRUD operations (Create, Delete, Update, Retrieval) on a persistent entity in Hibernate. For ColdFusion applications that use ORM, this session is automatically managed by ColdFusion. Hibernate sessions also act as the first level of cache, which ensures that only one copy of an object exists in the session.
When CRUD operations are performed in the session, data of the entity is not synchronized with the database immediately. That is, the SQL statements for the operations are not issued immediately and they are queued. The data is synchronized with the database when the session is flushed. When the session is flushed, the SQL operations are performed in the following order:
-
-
all entity updates
-
all collection deletions
-
all collection element deletions, updates, and insertions
-
all collection insertions
-
all entity deletions, in the same order the corresponding objects were deleted using EntityDelete()
The only exception to this is that objects with nativeId generation are inserted immediately when the object is saved.Note:ColdFusion creates and manages Hibernate sessions only if ormenabled is set to true in application scope.
When the ColdFusion application starts, it builds the Hibernate session factory that is available for the application life time. This factory is used to create Hibernate sessions that manage the persistent object lifecycle. When the first CRUD method is called, a Hibernate session gets created and is closed when the request ends or when the ormclosesessionmethod is called. For details on how ColdFusion works with Hibernate, see the Architecture.
In multiple data source scenarios supported in ColdFusion 9 Update 1, there are multiple sessions (one for each data source) in the same request. For all entity functions, the appropriate sessions are used transparently.
ColdFusion exposes a few methods to let CFML developers work with the Hibernate sessions directly. ORM session-related functions also take optional data source argument. If you do not specify a data source, the default data source specified for ORM is used. The methods are as follows: