Commit 1912d57
kasemir
RDB archive: Fix Oracle time zone problem.
The sample.smpl_time is handled differently for MySQL, Postgres, Oracle.
In MySQL, it's stored as UTC. The `Timestamp` passed to
`PreparedStatement.setTimestamp(Timestamp)` is converted to UTC and
stored as UTC. On retrieval, `ResultSet.getTimestamp` converts back to
the local time zone with appropriate GMT offset.
In Postgres, we need to use a `TIMESTAMPTZ` datatype that stores the
stamp with timezone info.
Both MySQL and Postgres handle the fall transition from daylight savings
time back to standard time just fine.
In Oracle, even if we use `TIMESTAMP WITH TIMEZONE` for smpl_time,
Oracle JDBC will second-guess the Timestamp passed to
`setTimestamp(Timestamp)` and change the time offset. During the DST
change in the fall, time stamps will be written with the wrong GMT
offset.
The workaround is to use `setObject(OffsetDateTime)` because
OffsetDateTime is passed through and written as received.1 parent e7c8343 commit 1912d57
File tree
3 files changed
+30
-30
lines changed- services/archive-engine
- dbd
- src/main/java/org/csstudio/archive/writer/rdb
3 files changed
+30
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
430 | 429 | | |
431 | 430 | | |
432 | 431 | | |
433 | | - | |
434 | | - | |
435 | | - | |
| 432 | + | |
| 433 | + | |
436 | 434 | | |
437 | 435 | | |
438 | 436 | | |
| |||
498 | 496 | | |
499 | 497 | | |
500 | 498 | | |
501 | | - | |
502 | | - | |
503 | | - | |
| 499 | + | |
| 500 | + | |
504 | 501 | | |
505 | 502 | | |
506 | 503 | | |
| |||
Lines changed: 24 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 34 | | |
47 | 35 | | |
48 | 36 | | |
| |||
77 | 65 | | |
78 | 66 | | |
79 | 67 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
83 | 73 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
0 commit comments