Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

How to delay hibernate connection from application startup in web app

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.


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.
The only cure for that is hours of television radiation. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!