Database edition cutover

  • Follow session edition selection through candidate validation, pool rotation and rollback.
Diagram phase
100%

Loan-creation proof of concept · session-scoped edition selection

Edition selection on a borrowed sessionSelect / reconcileRead / supplyservice keyservice keyresolve editionreadcolumnsExisting customerLoan creation pathNew customerLoan creation pathThread contextService keyBorrowed sessionSelect editionLogical offer viewEdition-specific columnsLoan mapperConsumes projectionservice keyservice keyresolve editionreadcolumns

Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.

  • An Oracle edition selects a version of database objects in a session. The same logical offer-view name can expose different columns to the two loan paths in this proof of concept.
  • Reading a known row through a reused pool connection checks both the session edition and whether the caller can interpret the columns it received.
  • The proof of concept carries service identity in thread context and selects the matching edition on the query session.
  • An adoption test must exercise connection reuse after an exception and the next borrow by the other loan path. Queue consumers also need an edition selection rule when they borrow a connection.
Database edition cutover

Database edition cutover

Loan-creation proof of concept · Oracle Database 19c editions

Session state in the local POC

  • The selected loan service writes its key into thread context. The query executor resolves a configured edition and selects that edition on the Oracle session before reading the logical offer view.
  • The existing-customer and new-customer paths read different projections. Before rollout, establish how every borrower selects its edition and resets its session after an exception.
  • Run the session/shape probe through the same borrowed connection as the application. Force an exception, return the connection, then borrow it for the other path. Assert the expected edition and known-row mapper result.
Inspect the borrowed session and view shapesql
-- Oracle Database 19c reference. Illustrative read-only checks.
-- Run through the same borrowed datasource connection as the application.
-- Compare service and edition with the approved route contract before a write.
SELECT SYS_CONTEXT('USERENV', 'SERVICE_NAME') AS db_service,
       SYS_CONTEXT('USERENV', 'SESSION_EDITION_NAME') AS session_edition
FROM dual;

-- Replace the view and columns with a controlled test projection for each
-- mapper. This zero-row shape check tests name resolution and column presence.
-- A separate fixture with known rows must test types, nullability and meaning.
SELECT offer_id, available_limit
FROM example_offer_view
WHERE 1 = 0;

First try a backwards-compatible contract

  • If both mappers can consume one stable projection, deploy the compatible database change first and validate both application generations. This avoids maintaining a second connection pool.
  • When concurrent incompatible projections are required, bind each supported route and generation to an explicit datasource pool and DB service with the required initial edition. Validate all paths, including queue consumers.
  • New physical sessions inherit the service’s initial edition. Verify the actual service/edition at borrow and discard an unexpected session before business work. Updating the service does not retarget existing pooled sessions.
Illustrative two-generation pool contractjson
{
  "example": "Illustrative server-to-datasource routing contract",
  "routes": [
    {
      "release": "R1",
      "loanPath": "existing-customer",
      "pool": "p1",
      "dbService": "offers_r1",
      "expectedEdition": "OFFERS_V1",
      "mapper": "offer-v1"
    },
    {
      "release": "R2",
      "loanPath": "existing-customer",
      "pool": "p2",
      "dbService": "offers_r2",
      "expectedEdition": "OFFERS_V2",
      "mapper": "offer-v2"
    }
  ],
  "promotionRequires": [
    "Verified service and session edition on fresh and reused pool connections",
    "Known-row mapper checks for each supported loan path and background worker",
    "Mixed-version writes remain readable by R1 and R2",
    "Room for both pool generations under the DB session ceiling"
  ],
  "rollback": {
    "precondition": "R1 code, pool, edition and write contract remain usable",
    "steps": [
      "Route new work to the validated previous generation",
      "Track and drain outstanding R2 work",
      "Reconcile effects and persistent messages across the change"
    ]
  },
  "cleanupRequires": [
    "All candidate and rollback readers released",
    "No remaining pool sessions or queued work require the old contract",
    "Database owner authorizes edition retirement"
  ]
}

Rehearse promotion and rollback

Check Decision
Release R2 expects a new column Test view name, types, null handling and a known offer on fresh and reused R2 connections.
R1 and R2 write during overlap Test old/new readers and writers against the shared table. Plan data transformation and crossedition triggers where mixed writes need them.
A background job lacks an edition mapping Hold that job and alert. Keep the existing bounded worker path serving.
New pools exceed DB session limits Reduce per-generation pool limits or defer overlap until capacity is available.
R2 fails after accepting work Stop new R2 admission, retain in-flight ownership and reconcile completed DB/CP effects before replay.
  • Preserve R1 code, resources, pool, edition and compatible rows through the rollback window. Helm rollback can restore release resources. Physical data changes, outstanding JMS work and remote CP effects require their own recovery.
  • Retire old sessions, mappers and edition objects only after queued work drains and the database owner confirms retirement eligibility.