henning 2003/01/08 07:49:34
Modified: examples Torque.properties
src/java/org/apache/torque/pool ConnectionPool.java
src/test Torque.properties
Log:
If we ship a file called "examples/Torque.properties", it should a least
resemble a working configuration. I haven't looked too deeply into this
but fixed the worst offenders. :-)
Removed all remaining references to timeout properties being in
milliseconds.
Revision Changes Path
1.3 +28 -83 jakarta-turbine-torque/examples/Torque.properties
Index: Torque.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/examples/Torque.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Torque.properties 19 Nov 2001 21:56:05 -0000 1.2
+++ Torque.properties 8 Jan 2003 15:49:34 -0000 1.3
@@ -3,120 +3,65 @@
#
# This is the configuration file for Torque.
#
-# Note that strings containing "," (comma) characters must backslash
+# Note that strings containing "," (comma) characters must backslash
# escape the comma (i.e. '\,')
#
# -------------------------------------------------------------------
+torque.applicationRoot = .
+
# -------------------------------------------------------------------
-#
+#
# L O G G I N G
#
# -------------------------------------------------------------------
-# We use Log4J for all Turbine logging and we embed the log4j
+# We use Log4J for all Torque logging and we embed the log4j
# properties within our application configuration.
-#
-# NOTE:
-# The presence of ${webapp} in the logging configuration
-# is not a mistake. Internally the value of ${webapp}
-# is set so that you can use it with standard log4j
-# properties to get logs to appear in your
-# webapp space.
# -------------------------------------------------------------------
# This first category is required and the category
# must be named 'default'. This is used for all logging
# where an explicit category is not specified.
-log4j.category.default = ALL, default
-log4j.appender.default = org.apache.log4j.FileAppender
-log4j.appender.default.file = ./torque.log
-log4j.appender.default.layout = org.apache.log4j.PatternLayout
-log4j.appender.default.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.default.append = false
-
log4j.category.org.apache.torque = ALL, org.apache.torque
log4j.appender.org.apache.torque = org.apache.log4j.FileAppender
-log4j.appender.org.apache.torque.file = ./turbine.log
+log4j.appender.org.apache.torque.file = ${torque.applicationRoot}/logs/torque.log
log4j.appender.org.apache.torque.layout = org.apache.log4j.PatternLayout
log4j.appender.org.apache.torque.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.org.apache.torque.append = false
-# This category is used in the BasePeer class. All
-# SQL generated will be logged if the category
-# priority is set to DEBUG
-
-log4j.category.sql = DEBUG, sql
-log4j.appender.sql = org.apache.log4j.FileAppender
-log4j.appender.sql.file = ./sql.log
-log4j.appender.sql.layout = org.apache.log4j.PatternLayout
-log4j.appender.sql.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.sql.append = false
-
# -------------------------------------------------------------------
-#
-# D A T A B A S E S E R V I C E
+#
+# T O R Q U E P R O P E R T I E S
#
# -------------------------------------------------------------------
-# These are your database settings. Look in the
-# org.apache.turbine.util.db.pool.* packages for more information.
-# The default driver for Turbine is for MySQL.
+# These are your database settings. Look in the
+# org.apache.torque.pool.* packages for more information.
#
# The parameters to connect to the default database. You MUST
# configure these properly.
# -------------------------------------------------------------------
-torque.earlyInit = true
-
-torque.database.default=default
-
-torque.database.default.driver=sun.jdbc.odbc.JdbcOdbcDriver
-torque.database.default.url=jdbc:odbc:torque
-torque.database.default.username=sa
-torque.database.default.password=
-
-torque.database.INTERPLANETARY.driver=sun.jdbc.odbc.JdbcOdbcDriver
-torque.database.INTERPLANETARY.url=jdbc:odbc:torque
-torque.database.INTERPLANETARY.username=sa
-torque.database.INTERPLANETARY.password=
-
-
-# The number of database connections to cache per ConnectionPool
-# instance (specified per database).
+torque.database.default=INTERPLANETARY
+torque.database.bookstore.adapter=mysql
-torque.database.default.maxConnections=80
-
-# The amount of time (in milliseconds) that database connections will be
-# cached (specified per database).
-#
-# Default: one hour = 60 * 60 * 1000
-
-torque.database.default.expiryTime=3600000
-
-# The amount of time (in milliseconds) a connection request will have to wait
-# before a time out occurs and an error is thrown.
-#
-# Default: ten seconds = 10 * 1000
-
-torque.database.default.connectionWaitTimeout=10000
-
-# The interval (in milliseconds) between which the PoolBrokerService logs
-# the status of it's ConnectionPools.
-#
-# Default: No logging = 0 = 0 * 1000
-
-torque.database.logInterval=0
-
-# These are the supported JDBC drivers and their associated Turbine
-# adaptor. These properties are used by the DBFactory. You can add
-# all the drivers you want here.
-torque.database.adapter=DBOdbc, DBMM
-torque.database.adapter.DBOdbc=sun.jdbc.odbc.JdbcOdbcDriver
-torque.database.adapter.DBMM=
-torque.database.adapter.DBMM=org.gjt.mm.mysql.Driver
+## Using torque's old pool
+torque.dsfactory.INTERPLANETARY.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
+torque.dsfactory.INTERPLANETARY.pool.defaultMaxConnections=10
+torque.dsfactory.INTERPLANETARY.pool.maxExpiryTime=3600
+torque.dsfactory.INTERPLANETARY.pool.connectionWaitTimeout=10
+torque.dsfactory.INTERPLANETARY.connection.driver=sun.jdbc.odbc.JdbcOdbcDriver
+torque.dsfactory.INTERPLANETARY.connection.url=jdbc:odbc:torque
+torque.dsfactory.INTERPLANETARY.connection.user=sa
+torque.dsfactory.INTERPLANETARY.connection.password=
# Determines if the quantity column of the IDBroker's id_table should
# be increased automatically if requests for ids reaches a high
# volume.
-torque.database.idbroker.cleverquantity=true
+torque.idbroker.cleverquantity=true
+
+# Determines whether the managers cache instances of the business objects.
+# And also whether the MethodResultCache will really cache results.
+
+torque.manager.useCache = true
1.16 +3 -3
jakarta-turbine-torque/src/java/org/apache/torque/pool/ConnectionPool.java
Index: ConnectionPool.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/pool/ConnectionPool.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ConnectionPool.java 10 Dec 2002 20:46:08 -0000 1.15
+++ ConnectionPool.java 8 Jan 2003 15:49:34 -0000 1.16
@@ -601,8 +601,8 @@
* frozes after certain amount of time/requests and you suspect
* that you have connection leakage problem.
*
- * Set the <code>database.logInterval</code> property to the number of
- * milliseconds you want to elapse between loging the number of
+ * Set the <code>logInterval</code> property of your pool definition
+ * to the number of seconds you want to elapse between loging the number of
* connections.
*/
protected class Monitor extends Thread
1.8 +9 -9 jakarta-turbine-torque/src/test/Torque.properties
Index: Torque.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/test/Torque.properties,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Torque.properties 27 Nov 2001 00:38:10 -0000 1.7
+++ Torque.properties 8 Jan 2003 15:49:34 -0000 1.8
@@ -72,24 +72,24 @@
torque.database.default.maxConnections=80
-# The amount of time (in milliseconds) that database connections will be
+# The amount of time (in seconds) that database connections will be
# cached (specified per database).
#
-# Default: one hour = 60 * 60 * 1000
+# Default: one hour = 60 * 60 seconds
-torque.database.default.expiryTime=3600000
+torque.database.default.expiryTime=3600
-# The amount of time (in milliseconds) a connection request will have to wait
+# The amount of time (in seconds) a connection request will have to wait
# before a time out occurs and an error is thrown.
#
-# Default: ten seconds = 10 * 1000
+# Default: ten seconds
-torque.database.default.connectionWaitTimeout=10000
+torque.database.default.connectionWaitTimeout=10
-# The interval (in milliseconds) between which the PoolBrokerService logs
+# The interval (in seconds) between which the PoolBrokerService logs
# the status of it's ConnectionPools.
#
-# Default: No logging = 0 = 0 * 1000
+# Default: No logging = 0
torque.database.logInterval=0
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>