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]/msg03639.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]>