I'm working on a task where application uses some configuration from database. Configuration is being stored in java persistent object. On server start Hibernate session gets created and all configuration data is loaded into object with lazy load option. Same object is used by concurrent user requests.
Structure of config data:
workflow:
for. eg. Person person is a hibernate entity. (java persistent obj.)
person object gets loaded with hibernate get list call on server start. Only one sessionfactory and session is initialized. DAO has only get call.
On subsequent server requests person object is accessed for its properties.
In general I am not sure how this setup will work for multiple and parallel server requests.
1) Keeping session open for long; will it cause any issue? 2) Is it a good practice? I understand session should be closed after each CRUD operation. But specifically for above workflow what should be the right approach. 3) Can multiple server request access the same persistent entity? (only get calls)
Looking for some guidane and help. Any inputs associated with design and performance.