You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by stewart titan <st...@yahoo.co.uk> on 2002/01/23 20:25:28 UTC

Torque.Iniit() - Re: Help with Torque

Hi Again,

One other thing, where is the Torque Class?

I've extracted all the .jar files, but cannot find a
Torque.class (or .java) file.

Thank you for your help.


Torque.init("ndb.properties");



__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque.Iniit() - Re: Help with Torque

Posted by Pete Kazmier <pe...@kazmier.com>.
On Tue, Jan 29, 2002 at 02:13:10PM -0600, Dave Everson wrote:
> Nice documentation Pete.

Thanks!

> My question is, what changes do I need to make in the configuration of
> a Turbine 2.1 webapp to seamlessly use the OM classes generated by the
> standalone Torque.  Do you have any documentation or suggestions on
> how to perform this?

Unfortunately, I don't have any suggestions to offer because I haven't
used Turbine 2.  Perhaps someone else on this list might be able to
offer some suggestions.

Thanks,
Pete

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Torque.Iniit() - Re: Help with Torque

Posted by Dave Everson <dj...@mygolftrac.com>.
Nice documentation Pete.
I just built/setup Torque 3, primarily because to get OM for a new
standalone application we are developing with Turbine.  We have several
requirements to expose this data via a Turbine Webapp as well.  My
question is, what changes do I need to make in the configuration of a
Turbine 2.1 webapp to seamlessly use the OM classes generated by the
standalone Torque.  Do you have any documentation or suggestions on how
to perform this?

Thanks.  

-----Original Message-----
From: Pete Kazmier [mailto:pete@kazmier.com] 
Sent: Wednesday, January 23, 2002 5:16 PM
To: Turbine Users List
Subject: Re: Torque.Iniit() - Re: Help with Torque

Torque 3 has not been released yet.  However, you can always download
the source from the CVS repositories and build it yourself.  See the
section "Obtaining the Torque Distribution" in my tutorial:

http://www.kazmier.com/~kaz/torque/tutorial.html

Or, to save you the time and elaborate:

1.  Download the repository

    cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
    (password is anoncvs)
    cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co
jakarta-turbine-torque

2.  Set lib.repo in your ${home}/build.properties file.  This should be
    a directory where you want to store all of the dependent jar files.

3.  ant update-jars

4.  ant dist

5.  Inside the bin directory you'll find 'torque-3.0-dev.zip', take that
    and unpack it somewhere.

Pete

On Wed, Jan 23, 2002 at 10:15:19PM +0000, stewart titan wrote:
> I've got the decoupled version of Torque - its the 2.x
> version.
> 
> http://jakarta.apache.org/builds/jakarta-turbine/release/2.1/
> 
> Where can I download version 3?
> 
> thanks.
>  --- Martin Poeschl <mp...@marmot.at> wrote: > 
> 
> > the Torque class only exists in the decoupled
> > version
> > if you want to use torque stand-alone you should use
> > 3.0-dev!!!!
> > 
> > cvs repo: jakarta-turbine-torque
> > 
> > martin
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
> 

-- 
Peter Kazmier                                 http://www.kazmier.com
PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Connecting to Postgres with Torque v3

Posted by Pete Kazmier <pe...@kazmier.com>.
On Thu, Jan 24, 2002 at 02:07:10PM +0000, stewart titan wrote:
> Also I'm wondering why the tutorial gives the example of:
> services.DatabaseService.bah.bah while the ??.properties config gives:
> 
> torque.database..bah.bah
> 
> Whats the difference?

What version of Torque are you using?  If you are using the standalone
(which is what the tutorial is for), then your run-time properties file
should have properties in the form of:

torque.database.*

If you are using the Torque that is coupled with Turbine, your run-time
propertise file should have properties in the form of:

services.DatabaseService.*

Again, the offer still stands, if you send me (to my email address) the
following:

    - build.properties
    - the contents of your schema directory
    - Torque.properties (the run-time properties)

I'd be happy to look at this in more detail for you.  I ran across the
same problem with my first app and it turned out to be something very
small (although I can't recall at the moment).

Thanks,
Pete

-- 
Peter Kazmier                                 http://www.kazmier.com
PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Connecting to Postgres with Torque v3

Posted by stewart titan <st...@yahoo.co.uk>.
Hi

I've looked at the torque toturial, and copied and
pasted the run time *.properties file:

I've copied the postgres.jar to Torque/lib directory.

When I run my app -  which is largly the same as the
tutorial example, I get the following exception

connection = null

/usr/local/development/jbuilder4/jdk1.3/bin/java
-classpath
"/home/stewart/files/development/java/torquetest/classes:/usr/share/pgsql/jdbc7.0-1.2.jar:/home/stewart/files/development/java/torquetest/torque/lib/commons-collections.jar:/home/stewart/files/development/java/torquetest/torque/lib/commons-util-0.1-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/jdbc2_0-stdext.jar:/home/stewart/files/development/java/torquetest/torque/lib/log4j-1.1.3.jar:/home/stewart/files/development/java/torquetest/torque/lib/torque-3.0-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/velocity-1.3-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/village-1.5.3-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/xerces-1.4.4.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/sunrsasign.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/rt.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/i18n.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/javaplugin.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/javaplugin_l10n.jar:/usr/local/development/jbuilder4/jdk1.3/lib/tools.jar:/usr/local/development/jbuilder4/jdk1.3/lib/dt.jar:/usr/local/development/jbuilder4/jdk1.3/demo/jfc/Java2D/Java2Demo.jar"
 org.stewarthector.TorqueTest.tester 
 connectin = null
java.lang.NullPointerException
	at
org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
	at
org.stewarthector.TorqueTest.Entity.BaseApplication.save(BaseApplication.java:306)
	at
org.stewarthector.TorqueTest.Entity.BaseApplication.save(BaseApplication.java:285)
	at
org.stewarthector.TorqueTest.tester.doStuff(tester.java:37)
	at
org.stewarthector.TorqueTest.tester.main(tester.java:20)


It throws the exception on the dbCon = ... line
    public void save(String dbName) throws Exception
    {
        DBConnection dbCon = null;
         try
        {
            dbCon = BasePeer.beginTransaction(dbName);
            save(dbCon);
        }
        catch(Exception e)
        {
            BasePeer.rollBackTransaction(dbCon);
            throw e;
        }
        BasePeer.commitTransaction(dbCon);



Also I'm wondering why the tutorial gives the example
of:
services.DatabaseService.bah.bah
while the ??.properties config gives:

torque.database..bah.bah

Whats the difference?


Below are the settings I've changed in the
?.properties file:

services.DatabaseService.database.default=default

services.DatabaseService.database.default.driver=org.postgresql.Driver
services.DatabaseService.database.default.url=jdbc:postgresql://server/apps
services.DatabaseService.database.default.username=stewart
# These are the supported JDBC drivers and their
associated Turbine
# adapter.  These properties are used by the
DBFactory.  You can add
# all the drivers you want here.

services.DatabaseService.database.adapter=DBMM
services.DatabaseService.database.adapter.DBMM=org.postgresql.Driver


services.DatabaseService.database.idbroker.prefetch=true

services.DatabaseService.earlyInit = true

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque.Iniit() - Re: Help with Torque

Posted by Martin Poeschl <mp...@marmot.at>.
stewart titan wrote:
> How stable is versino 3?

during the last month all patches and enhancements were checked in to 3.0 only!!
and there is a testbed for 3.0 (which does not exist for 2.x)
it will also be used for turbine 2.2 and the stuff in turbine-2 will be deprecated

so i strongly recommend to use 3.0 if you want to use torque stand alone

> 
> Better to use the version 2.x?

NO!


martin

> 
> thanks
>  --- Pete Kazmier <pe...@kazmier.com> wrote: > Torque 3
> has not been released yet.  However, you
> 
>>can always download
>>the source from the CVS repositories and build it
>>yourself.  See the
>>section "Obtaining the Torque Distribution" in my
>>tutorial:
>>
>>http://www.kazmier.com/~kaz/torque/tutorial.html
>>
>>Or, to save you the time and elaborate:
>>
>>1.  Download the repository
>>
>>    cvs -d
>>:pserver:anoncvs@cvs.apache.org:/home/cvspublic
>>login
>>    (password is anoncvs)
>>    cvs -d
>>:pserver:anoncvs@cvs.apache.org:/home/cvspublic co
>>jakarta-turbine-torque
>>
>>2.  Set lib.repo in your ${home}/build.properties
>>file.  This should be
>>    a directory where you want to store all of the
>>dependent jar files.
>>
>>3.  ant update-jars
>>
>>4.  ant dist
>>
>>5.  Inside the bin directory you'll find
>>'torque-3.0-dev.zip', take that
>>    and unpack it somewhere.
>>
>>Pete
>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque.Iniit() - Re: Help with Torque

Posted by stewart titan <st...@yahoo.co.uk>.
How stable is versino 3?

Better to use the version 2.x?

thanks
 --- Pete Kazmier <pe...@kazmier.com> wrote: > Torque 3
has not been released yet.  However, you
> can always download
> the source from the CVS repositories and build it
> yourself.  See the
> section "Obtaining the Torque Distribution" in my
> tutorial:
> 
> http://www.kazmier.com/~kaz/torque/tutorial.html
> 
> Or, to save you the time and elaborate:
> 
> 1.  Download the repository
> 
>     cvs -d
> :pserver:anoncvs@cvs.apache.org:/home/cvspublic
> login
>     (password is anoncvs)
>     cvs -d
> :pserver:anoncvs@cvs.apache.org:/home/cvspublic co
> jakarta-turbine-torque
> 
> 2.  Set lib.repo in your ${home}/build.properties
> file.  This should be
>     a directory where you want to store all of the
> dependent jar files.
> 
> 3.  ant update-jars
> 
> 4.  ant dist
> 
> 5.  Inside the bin directory you'll find
> 'torque-3.0-dev.zip', take that
>     and unpack it somewhere.
> 
> Pete


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque.Iniit() - Re: Help with Torque

Posted by Pete Kazmier <pe...@kazmier.com>.
Torque 3 has not been released yet.  However, you can always download
the source from the CVS repositories and build it yourself.  See the
section "Obtaining the Torque Distribution" in my tutorial:

http://www.kazmier.com/~kaz/torque/tutorial.html

Or, to save you the time and elaborate:

1.  Download the repository

    cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
    (password is anoncvs)
    cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co jakarta-turbine-torque

2.  Set lib.repo in your ${home}/build.properties file.  This should be
    a directory where you want to store all of the dependent jar files.

3.  ant update-jars

4.  ant dist

5.  Inside the bin directory you'll find 'torque-3.0-dev.zip', take that
    and unpack it somewhere.

Pete

On Wed, Jan 23, 2002 at 10:15:19PM +0000, stewart titan wrote:
> I've got the decoupled version of Torque - its the 2.x
> version.
> 
> http://jakarta.apache.org/builds/jakarta-turbine/release/2.1/
> 
> Where can I download version 3?
> 
> thanks.
>  --- Martin Poeschl <mp...@marmot.at> wrote: > 
> 
> > the Torque class only exists in the decoupled
> > version
> > if you want to use torque stand-alone you should use
> > 3.0-dev!!!!
> > 
> > cvs repo: jakarta-turbine-torque
> > 
> > martin
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

-- 
Peter Kazmier                                 http://www.kazmier.com
PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque.Iniit() - Re: Help with Torque

Posted by stewart titan <st...@yahoo.co.uk>.
I've got the decoupled version of Torque - its the 2.x
version.

http://jakarta.apache.org/builds/jakarta-turbine/release/2.1/

Where can I download version 3?

thanks.
 --- Martin Poeschl <mp...@marmot.at> wrote: > 

> the Torque class only exists in the decoupled
> version
> if you want to use torque stand-alone you should use
> 3.0-dev!!!!
> 
> cvs repo: jakarta-turbine-torque
> 
> martin
> 


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque.Iniit() - Re: Help with Torque

Posted by Martin Poeschl <mp...@marmot.at>.
stewart titan wrote:
> Hi Again,
> 
> One other thing, where is the Torque Class?
> 
> I've extracted all the .jar files, but cannot find a
> Torque.class (or .java) file.
> 
> Thank you for your help.
> 
> 
> Torque.init("ndb.properties");

there are 2 versions of torque!!!

2.2-dev which is part of turbine-2
3.0-dev which is the decoupled version (which will be used by turbine 2.2 and 3.0

the Torque class only exists in the decoupled version
if you want to use torque stand-alone you should use 3.0-dev!!!!

cvs repo: jakarta-turbine-torque

martin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>