public class EventStore extends Object
EventStore persists events into the database using plain JDBC and batched
INSERT statements.
The tables are keyed by a database IDENTITY column, so the writes work reliably across
multiple application nodes without any application-generated identifiers. The JDBC
Connection is borrowed from the host application's SessionFactory through the
ConnectionExecutor, which runs each unit of work inside a Hibernate transaction using
Session.doWork(org.hibernate.jdbc.Work). No entity is ever persisted through
the Session, so the runtime scanner is not re-triggered and there is no risk of recursion.
| Constructor and Description |
|---|
EventStore(EventPersistenceSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
long |
insertRun(String hibernateVersion,
List<Event> bootstrapEvents)
Insert a run (a bootstrap snapshot) and its associated configuration and mapping events,
using a single batched statement for the events.
|
void |
insertRuntimeRollups(Collection<RuntimeRollup> rollups)
Insert the aggregated runtime rollups using a batched statement.
|
public EventStore(EventPersistenceSettings settings)
public long insertRun(String hibernateVersion, List<Event> bootstrapEvents) throws SQLException
hibernateVersion - the current Hibernate versionbootstrapEvents - the configuration and mapping events collected during scanningSQLException - if a database access error occurspublic void insertRuntimeRollups(Collection<RuntimeRollup> rollups) throws SQLException
insertRun(java.lang.String, java.util.List<io.hypersistence.optimizer.core.event.Event>), or have a NULL run_id if there is none.rollups - the rollups to persistSQLException - if a database access error occursCopyright © 2026. All rights reserved.