fromSessionProvider

fun fromSessionProvider(provider: SessionProvider, ownsProvider: Boolean = true, dynamicJson: Json = octaviusJson, dynamicWriteStrategy: DynamicWriteStrategy = DynamicWriteStrategy.AUTOMATIC_WHEN_UNAMBIGUOUS): OctaviusClient

Builds a client over a SessionProvider of your own.

The seam for anything that decides which session an operation belongs on other than a ThreadLocal: a framework's transaction manager, or a test harness that pins every query to one connection and rolls it back at the end.

Return

A client ready to use.

Parameters

provider

Decides which session each operation runs on.

ownsProvider

Whether close should close provider as well.

dynamicJson

How dynamic_dto payloads are read and written. Only consulted where dynamic types are registered at all. The default is octaviusJson: strict, and carrying the contextual serializers a BigDecimal or an unbounded date needs to survive JSON.

dynamicWriteStrategy

When an unwrapped instance of a registered class is written as a dynamic_dto.