]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/RELEASE_NOTES_NEXT/Infrastructure/TZ_awareness.adoc
Docs: end-user documentation for Obalkyknih.cz added content
[working/Evergreen.git] / docs / RELEASE_NOTES_NEXT / Infrastructure / TZ_awareness.adoc
1 Client Timezone Awareness
2 ^^^^^^^^^^^^^^^^^^^^^^^^^
3
4 Previously, adjusting the time zone in which a database session operates
5 could not be done in any way except globally, directly within the database.
6 However, allowing modification of the timezone parameter now supports
7 localization efforts for those consortia that span multiple time zones.
8
9 Implementation
10 ++++++++++++++
11
12 CStore and other services that interact with the primary Evergreen database
13 make use of the functionality provided by LP#1485371 in OpenSRF in order to
14 set the time zone configuration parameter available in Postgres.  This has
15 the effect of interpreting all timestamps written to or read from the database
16 in the client's time zone.
17
18 Within CStore (and related, C-based services), all stateful sessions make use
19 of this capability, setting the database time zone upon a successful CONNECT
20 message from the client.  The time zone is reset to the database default when
21 a session is terminated either due to client DISCONNECT or server keepalive
22 timeout.
23
24 All stateless requests record the current database time zone, set the database
25 time zone to that of the client's, run the query, and then reset the database
26 time zone on each request that carries a client time zone value.  It is expect
27 that this will not cause any noticeable increase in latency or query execution
28 time, as this setting is local to the specific Postgres server backend process.
29
30 Within the Storage service, the timezone will be set automatically by a simple
31 wrapper method used by the existing method registration mechanism for method
32 publishing.  Disconnect and error callbacks are registered to revert the time
33 zone setting within the database.  This provides completely transparent time
34 zone manipulation for backend services that make use of open-ils.storage.