db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Atkins" <Brent.Atk...@pro-sys.biz>
Subject RE: (frustrated torque first timer) Please update the Tutorial
Date Wed, 06 Jul 2005 18:08:53 GMT
1. - The Torque Runtime Properties does pretty much what it says.  It
provides runtime information for Torque.  Yes you do need it.  It defines
the jdbc driver that you are using, the user name of a valid database user,
the url of the database, etc.  If you don't define these things your
application will not be able to log into the database or do anything else
for that matter.

2. - This is actually a good question that I wish I could answer.  Umm, so I
can't.  I would consider this to be a problem with the documentation.  For
now, I would say ignore it.  It doesn't matter and it's easier to edit an
existing Torque.properties file.  I can recommend the one included in the
Torque-3.1.1-src download under the /examples directory

3. - You need the Torque runtime jar and the Torque-gen jar. (the Torque-Gen
jar is NOT required in the runtime package; just to process the schema.  If
you are using Maven to generate your .war, simply omit the
<properties><war.bundle>true</war.bundle></properties> tag in your
You also need the dependencies that Torque has.  As mentioned in the
tutorial, the easiest thing is to grab the Torque POM and copy the
dependencies section from it.  Or you can download each one by looking at
the dependencies page.


It may seem like a pain in the ass, but most applications need many of these

4. - See http://db.apache.org/torque/dependencies.html

5. - It depends on how you are building your application.  But usually they
go in a lib directory.  (If you are using Maven, it puts them in the right
spot - usually)

6. - The better way is to use Maven.  Maven builds it's own classpath from
the POM.  I recommend reading up on Maven.  Otherwise, they all have to be
in your classpath.  Of course if you have them all in your /lib directory
this isn't too hard (ie. < one line).

7. - The database driver needs to be put into the /lib directory too.  If
you are using Maven, put the driver as a dependency in your POM and it will
grab it for you.  No biggie.

8. - I don't use PostgreSQL so I can't answer that.  Understand that as it
stands now, the Torque-3.1.1.jar is for runtime only.  If you are trying to
create tables and such you need Torque-gen-3.1.1.  This jar is used to
interface with the databases via the schema.  They split it up because you
don't need Torque-Gen during runtime.  For your own edification, using MySQL
using Maven to create my database works just peachy.

9. - Check the date.  The last time the tutorial was generated was October
2004.  Why?  I don't know, couldn't tell you.

10. - If you built the database manually, did you still make a schema?
Torque generates its class files from the schema, not the database.  BUILD
SUCCESSFUL indicated there were no errors in the build.  It may seem to you
that not generating a class file would constitute an error, but from the
program's prospective it's not an error to not compile something that
doesn't exist.  (forgive my double negative)

This should get you started a little.  The tutorial is quite dated now and
I'm not sure why.  After looking at the CVS, it seems that this is a
complaint more than a year and a half old.  I can tell you that after
working with Torque for a few years, it does work as advertised when your
settings are correct.  It's extra hard when users are using Torque for one
of their first real program.  (I'm just guessing as most programmers know
where to put dependencies and what runtime properties are)

What I would recommend...

Learn Maven first.  Use it to make a hello world application or something
stupid like that.  It took me a few days to wrap my head around the POM, but
it's actually pretty darn useful (Once you make your own repository that has
the blasted Sun jars on it at least - this is almost a funny joke once you
know Maven).  After you have a few POM's under your belt then grab Torque.
Using it is a matter of adding the dependencies (copy and paste from Torque
POM) and adding the actual Torque and Torque-gen dependencies.  Put in a
schema and a Torque.properties and you're pretty much done.  In the
meantime, maybe I'll take a look at that tutorial.  Someone should actually
rewrite it.  I'm getting tired of answering these questions :).

Good luck!

-----Original Message-----
From: yong LIANG [mailto:yong-liangliang@hotmail.com] 
Sent: Wednesday, July 06, 2005 1:16 PM
To: torque-user@db.apache.org
Subject: (frustrated torque first timer) Please update the Tutorial

As a first time user of torque I am a little bit frustrated with the
tutorial you provided as it does not answer all questions (in my opinion). 
Find those questions below. I'd really appreciate it if you could update the
In my opinion, there needs to be a tutorial (step by step, every single
thing explained, for newbies) and a user guide (explaining all features and
So the tutorial can't assume that the user knows much.

Here are those questions:

1. What is this Torque Runtime Properties thing you talk about? I have no
idea what that means or if I am supposed to do anything in this step.

2. If I unpack torque-3.1.1.zip, I do NOT see the directory structure that
you mentioned. Why not?

3. Exactly which files do I need? (At first you only talk about the two
Torque jars, but later you talk about dependencies)

4. Where do I get those files?

5. Where exactly (directory) do I put each of those files?

6. How do I handle those files? (E.g. which one has to be in my classpath? 
Do I only need to add the directory to the classpath or each and every
single jar? Istn't there a better way than the classpath?)

7. Where do I put the database driver? (Someone in this mailing list says it
has to be in %MAVEN_HOME%/lib/endorsed. If that is correct, why does the
tutorial not mention that? If there is a better location for that file, why
does the tutorial not talk about that?

8. Why does it not work to create/drop a database or tables in PostgreSQL
even if everything is set up correctly? Why do some on this list suggest to
use the SQL scripts manually instead of letting maven do that? Isn't that a
bug/problem in torque or maven?

9. Why does the tutorial not mention this issue?

10. If 'maven torque' works and I create the database manually and I create
the Bookstore.java application - what could be the reason that I get the
message "No java files to be compiled" and then BUILD SUCCESSFUL? This
process does not produce ANY class files anywhere. What did I do wrong?


Sorry for the frustrated voice in my mail. I didn't mean to insult anyone.
Please consider updating your tutorial quickly. That shouldn't take much
time, I think, as I believe all of those questions can be answered by an
experienced torque expert without thinking.



Take advantage of powerful junk e-mail filters built on patented MicrosoftR
SmartScreen Technology. 
  Start enjoying all the benefits of MSNR Premium right now and get the
first two months FREE*.

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message