You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Thomas Vandahl <tv...@apache.org> on 2011/10/02 19:19:18 UTC
Re: Torque 3.1.1 - change database url based on env (QA, TEST, etc.)
On 29.09.11 19:36, mrab wrote:
> I made that change, but still get the error. I did notice that I'm getting
> warnings as well. From one of them I saw that that the 'user' paramenter in
> server.xml needed to be 'username'. I fixed that and am now down to the
> original error and warnings as seen below. (I saw in a posted message from
> last year that you indicated that with those kind of warnings there was a
> database connection problem.) What I was wondering, since I have looked at
> the source for TorqueInstance.java, is whether the torque.database.default
> property is used by getConnection when you are using JNDI pooling. I ask
> because the test database name is 'inventory_test', but the production
> database name (my default in torque.properties) is 'inventory'. Is that
> going to be a problem?
Yes it is. The Torque database name is just a handle to a configuration
of a database connection pool whatever type it may be, JNDI or other. So
for the whole trick to work, you should select a fixed name for your
database handle to use in torque.properties and map that to default.
Don't change it for different environments. This is done at the
container (read: Tomcat) level.
BTW: You should seriously consider upgrading to Torque 3.3.
Bye, Thomas.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 3.1.1 - change database url based on env (QA, TEST,
etc.)
Posted by mrab <mi...@nscorp.com>.
mrab wrote:
>
>
> About the upgrade to 3.3, what are the steps for that?
>
> This is what I have done:
>
> 1) Added maven-torque-plugin-3.3 directory to /.maven/cache
> 2) Added torque-gen-templates-3.3.jar, torque-gen-3.3.jar, torque-3.3.jar
> to /.maven/repository/torque/jars
> 3) Added maven-torque-plugin-3.3.jar to /.maven/repository/torque/plugins
> 4) Changed the 3.1.1 references in project.xml to 3.3
> 5) Removed the 3.1.1 directory, jars, plugins
> 6) Removed the target directories from my application
> 7) Ran 'maven java:compile'
> 8) Got 'build failed' because of unsatisfied dependency
> 'torque:maven-torque-plugin:3.1.1:plugin'
> 9) Added the 3.1.1 stuff back in
> 10) Removed the target directories from my application
> 11) Ran 'maven java:compile'
> 12) Got 100 deprecation warnings on getMapBuilder and doDelete in BasePeer
> (still using 3.1.1, but why?)
> 13) Tried changing the dtd statement on my schema.xml file from 3_1 to
> 3_3, but that led to connection errors
>
> What have I missed?
>
>
Still trying to resolve this... I did discover files in the directory for
maven-turbine-plugin-1.3 that were looking at Torque 3.1: project.xml,
application-schema.xml, id-table-schema.xml, turbine-security-schema.xml.
Also, plugin.properties still had turbine.app.flavor = turbine-2.3.2 so I
change it to 2.3.3.
Now when I try 'maven -e torque:om' I get:
Errors stack :
>> Unable to obtain goal [torque:om]
>> File......
>> file:/home/ud177/.maven/cache/maven-torque-plugin-3.3/plugin.jelly
>> Element... torque-data-model
>> Line...... 292
>> Column.... 49
>> org.apache.torque.engine.EngineException: java.net.ConnectException:
>> Connection refused
>> java.net.ConnectException: Connection refused
>> Connection refused
Since I didn't have this problem with 3.1, what is different about Torque
3.3 with the connections?
Thanks!
Michele
--
View this message in context: http://old.nabble.com/Torque-3.1.1---change-database-url-based-on-env-%28QA%2C-TEST%2C-etc.%29-tp32503962p32689238.html
Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
Re: Torque 3.1.1 - change database url based on env (QA, TEST,
etc.)
Posted by mrab <mi...@nscorp.com>.
Thomas Vandahl-2 wrote:
>
> Yes it is. The Torque database name is just a handle to a configuration
> of a database connection pool whatever type it may be, JNDI or other. So
> for the whole trick to work, you should select a fixed name for your
> database handle to use in torque.properties and map that to default.
> Don't change it for different environments. This is done at the
> container (read: Tomcat) level.
> BTW: You should seriously consider upgrading to Torque 3.3.
>
Sounds like I would have to change the names of the databases to get this to
work. I'm not sure if I can make that happen.
About the upgrade to 3.3, what are the steps for that?
This is what I have done:
1) Added maven-torque-plugin-3.3 directory to /.maven/cache
2) Added torque-gen-templates-3.3.jar, torque-gen-3.3.jar, torque-3.3.jar to
/.maven/repository/torque/jars
3) Added maven-torque-plugin-3.3.jar to /.maven/repository/torque/plugins
4) Changed the 3.1.1 references in project.xml to 3.3
5) Removed the 3.1.1 directory, jars, plugins
6) Removed the target directories from my application
7) Ran 'maven java:compile'
8) Got 'build failed' because of unsatisfied dependency
'torque:maven-torque-plugin:3.1.1:plugin'
9) Added the 3.1.1 stuff back in
10) Removed the target directories from my application
11) Ran 'maven java:compile'
12) Got 100 deprecation warnings on getMapBuilder and doDelete in BasePeer
(still using 3.1.1, but why?)
13) Tried changing the dtd statement on my schema.xml file from 3_1 to 3_3,
but that led to connection errors
What have I missed?
Thanks!
Michele
--
View this message in context: http://old.nabble.com/Torque-3.1.1---change-database-url-based-on-env-%28QA%2C-TEST%2C-etc.%29-tp32503962p32600581.html
Sent from the Apache DB - Torque Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org