ORMFlushAll()
Flushes all open ORM sessions across all datasources. All pending CRUD operations in every active ORM session are saved to the database.
Requires Extension: Hibernate ORM Engine Extension
ORMFlushAll( );
Returns: void
This function does not take any arguments.
Usage Notes
editEquivalent to calling ORMFlush() for each active datasource session.
Useful when your application uses multiple ORM datasources and you want to flush all pending changes in one call.
Like ORMFlush(), prefer using transaction blocks over manual flush calls — calling ORMFlushAll() outside a transaction means each statement auto-commits individually with no rollback on failure.
See ORM - Sessions and Transactions for multi-datasource details.
Examples
edit// Save entities to different datasources, then flush all at once
entitySave( entityNew( "Auto", { id: createUUID(), make: "Toyota" } ) );
entitySave( entityNew( "Dealership", { id: createUUID(), name: "City Motors" } ) );
ORMFlushAll();
See also
- ORM
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)