Aside from a purely T5 way of doing it,

*You can also look up a JNDI source, configured in your web.xml and in a
context.xml, and then have a different context.xml on each server you deploy
to.  (This is assuming you can use the same dialect and options.)  I used to
switch back and forth between JavaDB (Derby) and Oracle, but the Oracle
stuff got so hairy I ended up just installing Oracle on a VM so the app
would behave.
You can specify the JNDI source in your hibernate.cfg.xml, etc.  A
server-specific context.xml can live on each app server.  If eclipse tries
to erase your context file, try defining it somewhere else, like a
server.xml or context.xml.default.  (at least in Tomcat)

*I bet you could do all sorts of maven/ant kung-fu packaging different
hibernate configs for different profiles.

*You can use a context.xml type file to store variables that your App
modules can load, for doing such useful things like turning on HTTPS only,
production mode, etc.  Then that over-the-phone-sys-admin can just poke
around the context.xml, instead of in your WAR directory, when the
servername needs to be switched, or a password changes.

Daniel

On Mon, Jan 26, 2009 at 5:38 PM, Howard Lewis Ship <hls...@gmail.com> wrote:

> You can contribute to the HibernateSessionSource service. Your
> contributions are objects that are used to configure the Hibernate.
> Such objects can decide what mode ("production" vs. "development") you
> are in, and set the correct values for various Hibernate Configuration
> properties.
>
> On Mon, Jan 26, 2009 at 12:39 PM, Graham Ford <grahamjf...@gmail.com>
> wrote:
> > Hi,
> >
> > Is there a way of setting the hibernate configuration file for the
> > HibernateModule? For example in my src/main/resources I want the config
> to
> > point to a live database, but for testing a different database. Is there
> a
> > way of doing this, without having to configure hibernate myself and then
> > adding it to the HibernateModule?
> >
> > Thanks,
> > Graham
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

Reply via email to