Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Timezones
Timezones [message #1862919] Sat, 06 January 2024 10:05 Go to next message
Mr Robot is currently offline Mr RobotFriend
Messages: 71
Registered: March 2020
Member
Greetings Scout community,

I'm working on an application with a single PostgreSQL database and multi-tenancy using the 'tenant_id' column on each table to split tenants. Each tenant requires support for different time zones.

I'm seeking advice on the best practices or recommended approaches for handling time zone support within a multi-tenant environment. How can I effectively manage time zone differences for each tenant in Eclipse Scout?

- I have tablePages using AbstractDateColumn and forms with AbstractDateField, all dates are stored in "timestamp without time zone" type columns. Is this ok?
- DB and App server are set to UTC.
- Do I need to convert all data after fetching from database to time with timezone of tenant, and then send it to client?
- Is it possible for each tenant to set timezone after login?

I found some posts on forum about timezone in Scout but I didnt get any help.

Any insights or examples would be immensely helpful.

Thank you for your assistance.

[Updated on: Sat, 06 January 2024 10:09]

Report message to a moderator

Re: Timezones [message #1862924 is a reply to message #1862919] Sun, 07 January 2024 10:14 Go to previous messageGo to next message
Mr Robot is currently offline Mr RobotFriend
Messages: 71
Registered: March 2020
Member
I was playing with AbstractUTCField and parsing value as UTCDate.

I saw when timezone of JVM is not UTC/GMT, that value is then converted to UTC in database.

My understanding of this for now is:
- all dates must be stored in UTC in database.
- I need to have timezone propery for each user of application.
- format all dates when fetched from database and add user timezone to then and then show it to client.
- I need to convert all AbstractDateFields to AbstractUTCDateField, in execValidateValue add timezone to value from user settings and convert them to new UTCDate() which will be sent to server.

Re: Timezones [message #1862925 is a reply to message #1862924] Sun, 07 January 2024 11:55 Go to previous message
J D is currently offline J DFriend
Messages: 100
Registered: February 2021
Senior Member
Hi there M. Robot,

I would personally do that in Docker containers. One App server container per tenant in a specific timezone. The container instance can be initialized on the docker command line with the timezone (UTC +/-) so your date fields will contain the tenant's correct timezone. The App server containers can use the same container instance of PostgreSQL and the same data volume OR if you wish, a non-containerized local PostgreSQL installation.

This configuration may be easier for overall administration.

Cheers,

JD

[Updated on: Sun, 07 January 2024 13:04]

Report message to a moderator

Previous Topic:MSSQL Integration
Next Topic:SimplePrincipal with a specified user name not working as expected after login
Goto Forum:
  


Current Time: Wed May 08 11:13:35 GMT 2024

Powered by FUDForum. Page generated in 0.04549 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top