Implement static variable synchronization and database initialization in the constructor