Date: 2004-08-19T21:41:40
   Editor: ScottEade <[EMAIL PROTECTED]>
   Wiki: DB Torque Wiki
   Page: TutorialErrata
   URL: http://wiki.apache.org/db-torque/TutorialErrata

   The tutorial update has addressed all of the problems previously listed.

Change Log:

------------------------------------------------------------------------------
@@ -1,132 +1,6 @@
-= The existing Tutorial should be used with Torque-3.0! =
+= The Tutorial has been updated for Torque-3.1! =
 
-If someone would like to indicate updates that are necessary to bring the tutorial up 
to the latest release then please note your findings here.
+If you find any problems with the Tutorial you can list them below.
 
 ----
 
-I tried to follow the tutorial on the torque web site. It worked very well except for 
the following issues, which I had difficulties with:
- * It took me a while to figure out that I should have downloaded torque-gen as well 
as torque itself in step 1 (Ok, the link points at a directory where both files are 
listed, but a short hint for the stupid cannot hurt ;-)). It seems that the tutorial 
is not yet adapted to the situation of a separate generator. Some files which are said 
to be in the root of torque are actually located in the root of torque-gen.
- * Also, it would be worth while mentioning that one should call 
{{{Torque.init(path_to_config_file)}}} at the start of the java code, before one 
starts using torque classes.
-
--- ThomasFischer in [http://nagoya.apache.org/scarab/issues/id/TRQD26 TRQD26]
-
-
-----
-
-= Towards a tutorial for Torque-CVS =
-
-I just got the CVS version of Torque to generate XML schema from my running db, so I 
will post some things that I think might be nice to have in a tutorial.
-
- * the directory structure is nothing like that listed in any of the docs, which is 
really vexing....
- * so I used maven, that seeming to be the thing to do, and because I couldn't find 
the files to modify to go the ant route.
- * In retrospect, maven use could be pretty painless, except for the following 
problem that kept tripping me up.  If I did the following:{{{
-    cd db-torque 
-    maven install:plugin
-    maven torque:jdbc
-}}}
-
- Then I would get an error, as the maven plugin could not find the source for my 
org.postgres.Driver.  The only fix I could figure out was to directly edit 
{{{~/.maven/plugins/maven-torque-plugin-3.2/project.xml}}} and insert the following 
dependecy node: {{{
-    <dependency>
-      <id>postgresql</id>
-      <version>7.4.1-jdbc3</version>
-      <properties>
-        <classloader>root</classloader>
-      </properties>
-    </dependency>
-    }}}
-
- I could not get this dependency to stick by editing any of the project.xml files in 
db-torque, nor in {{{myproject/project.xml}}}.  After adding that hack, the following 
worked: {{{
-    mkdir newproject
-    cd newproject
-    [create project.xml]
-    mkdir -p src/schema
-    touch src/schema/schema.xml
-    maven torque:jdbc
-}}} producing the following output (with my server name changed) {{{
-|  \/  |__ _Apache__ ___
-| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
-|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc1-SNAPSHOT
-
-torque:init:
-
-torque:jdbc:
-    [torque-jdbc-transform] Torque - JDBCToXMLSchema starting
-    [torque-jdbc-transform] Your DB settings are:
-    [torque-jdbc-transform] driver : org.postgresql.Driver
-    [torque-jdbc-transform] URL : jdbc:postgresql://your.server.com:5432/tracer
-    [torque-jdbc-transform] user : susieq
-    [torque-jdbc-transform] schema : 
-    [torque-jdbc-transform] DB driver sucessfuly instantiated
-    [torque-jdbc-transform] DB connection established
-    [torque-jdbc-transform] Getting table list...
-    [torque-jdbc-transform] Building column/table map...
-    [torque-jdbc-transform] Processing table: arbitrary_points
-    [torque-jdbc-transform] Processing table: geometry_columns
-    [torque-jdbc-transform] Processing table: gps_obs
-    [torque-jdbc-transform] Processing table: gps_segment
-    [torque-jdbc-transform] Processing table: gps_trace
-    [torque-jdbc-transform] Processing table: spatial_ref_sys
-    [torque-jdbc-transform] /home/susieq/javawork/newproject/src/schema/schema.xml
-    [torque-jdbc-transform] Torque - JDBCToXMLSchema finished
-BUILD SUCCESSFUL
-Total time: 12 seconds
-Finished at: Wed Mar 17 16:25:13 PST 2004
-}}}
-
-----
-
-=  I suppose Torque.properties in the tutorial should be updated? =
-
-I've spend a day figuring out what's wrong with the Bookstore example (I used 
torque-3.1.tar.gz and torque-gen-3.1.tar.gz) as I always get the following error 
messages:
-{{{ 
-[WARN] IDBroker - -IDBroker is being used with db 'bookstore', which does not support 
transactions. IDBroker attempts to use transactions to limit the possibility of 
duplicate key generation.  Without transactions, duplicate key generation is possible 
if multiple JVMs are used or other means are used to write to the database.
-java.lang.NullPointerException: There was no DataSourceFactory configured for the 
connection bookstore
-
-}}}
-
-My original '''Torque.properties''' file I used from the old tutorial
-
-{{{ 
-log4j.rootCategory = DEBUG, default
-log4j.appender.default = org.apache.log4j.FileAppender
-log4j.appender.default.file = ./torque.log
-log4j.appender.default.layout = org.apache.log4j.SimpleLayout
-
-torque.database.default = bookstore
-torque.database.bookstore.driver = org.gjt.mm.mysql.Driver
-torque.database.bookstore.url = jdbc:mysql://127.0.0.1/bookstore
-torque.database.bookstore.username = user
-torque.database.bookstore.password = password
-}}}
-
-The above '''Torque.properties''' does not work.  So I tried the new one indicated in 
-[http://db.apache.org/torque/configuration-howto.html Pool-config Howto]
-
-{{{ 
-torque.dsfactory.bookstore.factory= 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
-torque.dsfactory.bookstore.pool.defaultMaxActive=30
-torque.dsfactory.bookstore.pool.testOnBorrow=true
-torque.dsfactory.bookstore.pool.validationQuery=SELECT 1
-torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver
-torque.dsfactory.bookstore.connection.url = jdbc:mysql://localhost:3306/bookstore
-torque.dsfactory.bookstore.connection.user = root
-torque.dsfactory.bookstore.connection.password = 1234
-}}}
-
-Then I could run the bookstore example.  I'm not too sure if this type of 
configuration should be mention  
-in the tutorial but it sure works for me.  Thanks
-
-=  Another reason for "... no DataSourceFactory configured ..."  =
-
-I am using SAPDB had some problems to get my test application running. The reason was 
that some code uses upper case. So, when my database property is:
-{{{
-torque.database.default=foo
-}}}
-
-I have to use upper case in all other properties:
-{{{
-torque.dsfactory.FOO.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
-...
-}}}
-
-At least it works for me now.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to