Got a question ;)
Why does the doBuild() method in all of the Torque-generated peers have the
database map hard coded?
dbMap = TurbineDB.getDatabaseMap("jstore");
The reason I bring this up is because I had changed a couple of things
around when I was building my app where this caused me problems. I had a
project name of "store", but I wanted the database to be called "jstore."
So, after running the first ant to create the project in the webapp
directory, I went into build.properties and changed both the
Turbine-schema.xml and store-schema.xml from <database name="store"> to
<database name="jstore">. I also changed the idTableDatabase from
"idTableDatabase = store" to "idTableDatabase = jstore" then ran "ant init"
which created these entries in my turbine.properties
database.store.driver=org.gjt.mm.mysql.Driver
database.store.url=jdbc:mysql://127.0.0.1/jstore
database.store.username=-----
database.store.password=-----
services.PoolBrokerService.defaultPool = store
services.MapBrokerService.defaultMap = store
But all the map classes had the line:
dbMap = TurbineDB.getDatabaseMap("jstore");
in the doBuild() method which was causing all off my peers to fail with a
"connection is null!" exception.
After changing all references to "store" to "jstore" in the above lines in
turbine.properties everything worked fine.
My point is, why not grab the value for the default map from
turbine.properties like this:
dbMap =
TurbineDB.getDatabaseMap(TurbineResources.getString("services.MapBrokerServi
ce.defaultMap"));
Would this not make things a little more flexible and less prone to error
(IMOHO hard-coding is not the best approach)? Am I think correctly here or
is my logic totally off base.
Regards,
Scott
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>