I have a Java application hosted in a Tomcat servlet container which queries a database and creates an in-memory model (very big) with the results. The code to create the in-memory graph takes around 3 minutes to run so I'm keen to be able to do this as the application is started and before the users can access the application.
Is there a typical patterned approach for doing this?