Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

Global list of synchronized objects #28

Closed
maciaszczykm opened this issue Apr 7, 2014 · 4 comments
Closed

Global list of synchronized objects #28

maciaszczykm opened this issue Apr 7, 2014 · 4 comments
Assignees
Milestone

Comments

@maciaszczykm
Copy link
Owner

New interface needs to be created. Objects synchronized with database should be stored in map or structure like it.

@maciaszczykm
Copy link
Owner Author

Satisfies #27 issue:

If database structure contains loop it is possible for application to have one too. 
It cannot happen.

maciaszczykm pushed a commit that referenced this issue Apr 19, 2014
@maciaszczykm
Copy link
Owner Author

Avoid loading of same object more than once. Check how global objects list can be used to achieve it. Maybe it should be used in other CRUD methods too?

Sample loop in database structure:

DROP DATABASE EMPLOYEES;

CREATE DATABASE EMPLOYEES;

USE EMPLOYEES;

CREATE TABLE COMPANY (
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
COMPANYNAME VARCHAR(30),
EMPLOYEE INT);

CREATE TABLE EMPLOYEE (
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
FIRSTNAME VARCHAR(10),
LASTNAME VARCHAR(20),
BIRTHDAY DATE,
GENDER VARCHAR(6),
COMPANY INT,
HIREDATE TIMESTAMP,
SALARY DOUBLE,
CHILDREN INT,
FOREIGN KEY(COMPANY) REFERENCES COMPANY(ID));

ALTER TABLE COMPANY ADD FOREIGN KEY (EMPLOYEE) REFERENCES EMPLOYEE(ID);

COMMIT;

@maciaszczykm
Copy link
Owner Author

Load objects from database or cache (pointer to currently synchronized object from global list)? Check how Hibernate handles it.

@maciaszczykm
Copy link
Owner Author

Objects are loaded always from database.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant