-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy connection usage when initalizing an EntityManager #2213
Comments
one should be able to control this through the deploy-on-startup property |
@lukasj if I am reading that property correctly eclipselink.deploy-on-startup=false (lazy)(default)
The lazy configuration which is default initializes the persistence unit upon EntityManager creation. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
As a user of EclipseLink and OpenLiberty I notice that my application starts slowly because when an EntityManager is created during application start a Connection is made to the Database to initialize the entity manager (see stack below).
This type of eager initialization does not work well when deploying an application in a container environment. An orchestrator needs to verify applications have started as it scales up. Long wait times for application start could cause an orchestrator to over scale to meet demand which can be handled by a fewer number of pods.
Describe the solution you'd like
I would rather my application start fast, and pay the cost of creating a connection when the connection is actually needed (i.e. during the first persist() operation).
Describe alternatives you've considered
None.
Additional context
This feature would also be useful for systems utilizing checkpoint/restore (CRIU) since an entity manager could be initialized in an pipeline environment without access to the production database. A checkpoint taken, and then restored in an environment where the production database is available.
The text was updated successfully, but these errors were encountered: