• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delay hibernate connection from application startup in web app

 
Cory Max
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I have a rather unique (I think) problem. Currently we have a java web application and hibernate objects are being loaded through the web.xml

This works great because hibernate gets loaded when the web app starts up. The problem is now we would like hibernate to not start until after the user has entered the database username and password credentials, inside the web application. How can I stop hibernate from starting until this has happened?

I think I will have to remove the spring-hibernate, datasource, etc from the web.xml, but how to I get the spring container to load those files later (after the web app is running) and pass in the username and password dynamically instead of having them static in the xml files?

I hope this made sense to someone :-). Please ask questions if you have any.

Thanks,

Yeuker
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can start Hibernate any time you want to. See the documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic