You may try:
        dbCon = BasePeer.beginTransaction(Torque.getDefaultDB());
(replace dbName with Torque.getDefaultDB()).  

Zhangling Ren

> -----Original Message-----
> From: John McNally [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 02, 2002 7:55 PM
> To: Turbine Users List
> Subject: Re: Unable to execute Torque (outside of Turbine) test
> application
> 
> 
> If you have named your db "ndb_test" then you need some database
> properties for that db.
> 
> e.g.
>                                      
> services.DatabaseService.database.ndb_test.driver=org.postgres
> ql.Driver
>                                      ^
> john mcnally
> 
> sbelt wrote:
> > 
> > More info:
> > 
> > By putting some System.out messages in the BasetAcl.java 
> code, I have
> > narrowed it down. I am gagging on the command:
> > 
> >     dbCon = BasePeer.beginTransaction(dbName);
> > 
> > I have verified that the dbName parameter is correctly set 
> to "ndb_test". Is
> > the fact that this method is called beginTransaction and 
> the log message ~
> > "connected to a database that does not support 
> transactions" indication of
> > my problem? Postgres supports transactions, right? Does 
> this mean I have
> > incorrect connection parameters?
> > 
> > I have:
> > 
> > services.DatabaseService.database.default=default
> > 
> > 
> services.DatabaseService.database.default.driver=org.postgresql.Driver
> > 
> services.DatabaseService.database.default.url=jdbc:postgresql:
> //localhost/nd
> > b_test
> > services.DatabaseService.database.default.username=username
> > # I have not yet set a password until I get things working
> > services.DatabaseService.database.default.password=
> > 
> > then
> > 
> > services.DatabaseService.database.adapter=DBPostgres
> > 
> services.DatabaseService.database.adapter.DBPostgres=org.postg
> resql.Driver
> > 
> > Is this not right? I'm afraid I am stuck at this point. :/
> > 
> > Thanks for any assistance!
> > 
> > Steve B.
> > 
> > ----- Original Message -----
> > From: "sbelt" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 02, 2002 12:46 PM
> > Subject: Unable to execute Torque (outside of Turbine) test 
> application
> > 
> > > Might someone be able to help?
> > >
> > > I am trying to create an application (called ndbTest) 
> starting with
> > Torque.
> > > I have been able to create my database (named ndb_torque) 
> using the
> > scripts
> > > created by Torque. Torque has also created my peer 
> classes and compiled
> > them
> > > successfully. I am now trying to run a simple app to test 
> what I have done
> > > so far.
> > >
> > > My problem is that when I reache the .save( ) command in 
> my test app, I
> > get:
> > >
> > > java.lang.NullPointerException
> > >     at
> > > 
> org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
> > >     at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:1004)
> > >     at com.zeroton.ndb.om.BaseAcl.save(BaseAcl.java:983)
> > >     at com.zeroton.ndb.ndbTest.main(ndbTest.java:29)
> > >
> > > Any ideas on how I can begin to track down my issue(s)?
> > >
> > > Background:
> > > 1) I am using the following information as my guide:
> > >
> > > 
> http://www.mail-archive.com/[email protected]/ms
> g03639.html
> > >
> > > 2) I have created a properties file named 
> /developer/torque/ndb.properties
> > > making slight modifications to use     Postgresql instead 
> of mysql -
> > namely:
> > >         - I have modified the driver name to be 
> org.postgresql.Driver,
> > >         - the URL to be jdbc://localhost:5432/ndb_test
> > >         - the username and password have also been set
> > >         - I have modified the log4j settings to create a file name
> > > ndbTest.log
> > >
> > > 3) The schema.xml used the following to define the table 
> I am trying to
> > > uypdate:
> > >     <table name="t1" idMethod="native" javaName="Acl">
> > >         <column name="x1"
> > >             javaName="AclId"
> > >             primaryKey="true"
> > >             required="true"
> > >             autoIncrement="true"
> > >             type="BIGINT"  <!-- db.props defines BIGINT 
> to be int4 -->
> > >          </column>
> > >         <column name="x2"
> > >             javaName="ReadList"
> > >             primaryKey="false"
> > >             required="false"
> > >             autoIncrement="false"
> > >             size="1024"
> > >             type="VARCHAR"  <!-- db.props defines BIGINT 
> to be int4 -->
> > >          </column>
> > >     </table>
> > >
> > > 4) My code is as follows:
> > >
> > > import com.zeroton.ndb.om.*;
> > > import org.apache.torque.Torque;
> > > import org.apache.torque.Torque;
> > >
> > > public class ndbTest
> > > {
> > >     public static void main(String[] args)
> > >     {
> > >         try
> > >         {
> > >             //Initialize torque
> > >             Torque.init("/developer/torque/ndb.properties");
> > >
> > >             //Create an ACL entry
> > >             Acl refAcl = new Acl();
> > >             //Set one of the fields
> > >             refAcl.setReadList("ALL");
> > >             //Save it
> > >             refAcl.save();                 <!-- **** this 
> is the line that
> > > is giving the error -->
> > >
> > > ... catch exceptions then loop/print table contents ...
> > >
> > > In the ndbTest.log file, the only Warning I see is the 
> idBroker string
> > > reporting that it is connected to a database that does not support
> > > transactions. Since I am not using idBroker for my 
> indexes, I did not
> > think
> > > this should concern me (?).
> > >
> > > TIA,
> > >
> > > Steve B.
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > 
> > --
> > To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

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

Reply via email to