I'm with you Barry. I've had much better luck getting DB connections out of
the web app configuration and into a more neutral location. Something that
allows me to run the services and test code from the command line. This
leads to much better developer productivity overall.
Michael Grundvig
Electrotank, Inc
http://www.electrotank.com
----- Original Message -----
From: "Barry Books" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Monday, December 18, 2006 9:31 AM
Subject: Re: DB-Connection
I switched to injecting connections with Hivemind and I would say it's
well worth the effort. I could never figure out how to test code when
using the Tomcat database connections but with the Hivemind method you
can just get a connection and add it to the objects you want to test.
There is an example in the tapestry-examples/TimeTracker application.
It's a bit difficult to setup the first time and involves Hivemind and
Java Proxies, but in the end it's well worth the effort. I also create
a separate Eclipse project called TestDB that can create test database
connections the in my test code I do this
private static Repository repository;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
repository = Repository.newTestInstance(TestConnection.getConnection());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]