|
From: Ezra E. <eep...@pr...> - 2004-02-15 03:02:08
|
First off, I tried searching the existing list, but since it's sourceforge, search doesn't work. I tried: "hibernate", "datasource", etc. No luck. Even tried "IHibernateTemplate" which is saw in to topic of one post and that returned an empty set as well. Sigh. Wouldn't a searchable phpBB forum be nice... Meanwhile, the issue at hand. I'm using Hibernate. I've read about Spring. I'm thinking Spring sounds great. Want to move to include it. This being a needs-driven development effort, we have a problem with Hibernate: it has zero support for stored procedures. So, enter Spring. Nice support for arbitrary JDBC/SQL. Just write the result-set row handler and you are done. Sounds perfect. 3 hours later I've abandoned Spring. Why? Well, Spring wants everything to include a DataSource. But we run Hibernate in 2 modes: stand-alone, for testing and inside a container for web deployed apps. Currently we configure Hibernate directly -- easy, external hibernate.cfg.xml file. But Hibernate's "abstraction" is all based on a java.sql.Connection object, which for sending queries, makes perfect sense. So, for the life of me, I can't figure out why Spring always wants a DataSource and rather than change everything that currently works and move it all over so that Spring handles configuration and gives itself a DataSource, I've decided it's not worth it. By then I could have written the calls and handlers in plain JDBC 3 times over.... Again, this is a needs-driven effort. 2 questions: 1. Is there a different entry point to all of Springs JDBC utility methods that relies on a lowly connection object instead of a DataSource? 2. If not, why not? Thanks, == Ee |