Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accelerate application startup on Jetty

I have a small web application configured with Guice, Jersey and EclipseLink, and run this application on jetty (8.0.0.M1) during development. There are about 10 (small) JPA managed classes (entities and embeddables), and about 20 classes total.

The initial startup takes 15 seconds + 5 seconds for the first requests. It seems like JPA is working on the first request, since I have the table generation strategy "create" enabled and see some JPA output from Maven on the first request.

A reload takes about 10 seconds and the first request after reloading takes about 3 to 4 seconds.

You may think, that the startup time is not so bad, but I'm wondering if I could accelerate the startup to work more fluently like with Django. Any idea for startup tuning?

like image 868
deamon Avatar asked Nov 11 '10 11:11

deamon


1 Answers

I'm afraid that if you are not prepared to remove the table creation strategy, you will have to tolerate such loading times. In essence, everytime your startup your application, it will drop/create/verify the tables and issue the correct DDL statements to make it match the entities in your package.

Assuming that you're done defining your entities and you are working on some business-logic code, you can create the database once, and just re-use your initial setup.

like image 57
Claude Houle Avatar answered Sep 30 '22 16:09

Claude Houle