tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Thomerson" <co...@jeremythomerson.com>
Subject Re: Avoid duplication of database settings
Date Thu, 12 Jan 2006 03:24:34 GMT
Yes - Spring would be very handy for your usage.  You can configure your 
your entire middle tier (services and persistence) within your Spring 
configuration, and then share it between the multiple clients.  You can then 
inject the services into various objects, or pull them from a global 
singleton-like application context.  You can also use it to help you 
configure things like internationalization.  I'd highly recommend a Spring / 
Hibernate combo, or even just Spring if you already have a persistence layer 
you don't want / need to change.

Jeremy Thomerson
eBay

----- Original Message ----- 
From: "Fredrik Rubensson" <fredrik.rubensson@mogul.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Tuesday, January 10, 2006 4:17 AM
Subject: Re: Avoid duplication of database settings



Sorry about the "antispammed" subject in my previous post.

>>> I have an application consisting of a web application and some stand
>>> alone java clients. Both the web application and the java clients
use
>>> a database. The problem is that the database configuration is
>>> duplicated.
>
>> If you are doing it the ant way I recommend using filtering.
>
> Thanks for the suggestion. I will have a look at it.
>
>Do you know if frameworks like Spring or Hibernate solves this kind of
problems?

I don't know about spring but in hibernate there is one configuration
file that you can share between webapp and standalone clients. (Using it
in my current project.) If you only use Hibernate to access your
database you will be fine. It is also possible to get the DataSource
from the hibernate configuration if you want to access the database
directly (for performance reasons). I have some SQL scripts that need
the database info so I use filtering anyway both as a way to have the
configuration values in one place and as a way to easily build for
different environments.

Regards,
Fredrik



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message