Runtime Behavior
Request Lifecycle (REST)
Typical REST path for UI-driven operations:
-
HTTP request enters Spring MVC controller under the servlet context path
/configs-service. -
SecurityConfigenforces authentication/authorization:-
JWT is read from HTTP-only cookie (
ACCESS_TOKEN) withAuthorization: Bearer …fallback (JwtAuthenticationFilter). -
CSRF protection uses cookie-based token repository (
CookieCsrfTokenRepository).
-
-
Controller delegates to a
@Servicemethod. -
The service executes a transaction (
@Transactional) and persists changes via Spring Data repositories. -
Domain-specific cache services publish derived snapshots into Hazelcast (see Caching Strategy).
-
Exceptions are converted into a stable error contract by
GlobalExceptionHandler(Error Handling).
Transaction Boundaries
-
Write paths are generally annotated with
@Transactionalat the service level (for exampleAuthService,TabService,NorthboundConfigService). -
Read paths use
@Transactional(readOnly = true)where implemented. -
Open-session-in-view is disabled (
spring.jpa.open-in-view=falsein profile YAMLs), so lazy loading must happen inside service transactions.
Post-commit behavior (important)
-
Auditing is explicitly post-commit:
AuditEventListenerlistens with@TransactionalEventListener(phase = AFTER_COMMIT)and persists audit in a separate transaction (AuditLogWriterusesREQUIRES_NEW). -
Cache publication is not consistently post-commit today: many domain services call cache refresh methods inside the same
@Transactionalmethod. This means Hazelcast may observe changes before the DB transaction commits (or even if the transaction later rolls back).This is a known correctness risk for consumers that read Hazelcast directly (ACS, northbound-api, provisionportal, serviceapi, angular backend).
Threading Model
-
Virtual threads are enabled for request handling (
spring.threads.virtual.enabled=trueinsrc/main/resources/application.yml). -
Audit persistence is asynchronous and uses a bounded executor (
AuditConfig#auditExecutor) to avoid blocking request threads and to protect the database from unbounded concurrency.
Background/Startup Work
Liquibase
Liquibase runs on application startup when liquibase-core is present and db/changelog/db.changelog-master.yaml exists at the default Spring Boot location (src/main/resources/db/changelog/db.changelog-master.yaml).
Bootstrap operations
-
Bootstrap administrator provisioning:
AdminBootstrap(runs once at startup if noADMINexists andft-configs.bootstrap.admin.*is set). -
TabView bootstrap import:
TabViewBootstrapRunnerimports XML resources into empty TabView tables on first install only (it checkstabRepository.count()andnamespaceRepository.count()). -
Cube DSL warm-up:
CubeDslCacheServicewarms cache onApplicationReadyEventunder a read-only transaction.