Calendar, optimization and lazy loading

Hi everyone,

I’m building an entreprise app (with CDI and EJB) using the Vaadin Calendar and I’m trying to understand how this one is working.

I want to use my EJB methods in the container to query the database.

The calendar provider is using the method getEvents(Date startDate, Date endDate) to only get the needed events to display.
But we still need to load all the events in the container. Is it possible to lazy load these events in the container depending of the requirements of the getEvents(…) method ?

Thanks a lot,


I got my solution.
I was previously trying to implement my own container but that was not the optimal solution.

I’m now using my own CalendarEventProvider, so I’m overriding the getEvents(…) method to use my stateless EJB to retreive the data from the database.
So the calendar is now kind of a lazy load because it’s only retreiving the events it needs to display.

The problem using the container is you need to load everything in the container and the getEvents() look for events in the container. But everything is loaded in the JVM.