db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruy Diaz Jara <diaz_...@yahoo.com>
Subject Problem with doDelete (null pointer)
Date Thu, 25 Nov 2004 00:33:27 GMT
Hi all,

The strangest thing is happening. I am having trouble deleting from one of my
tables, upon calling doDelete(), I receive a null pointer Exception:

java.lang.NullPointerException
	at org.apache.torque.util.BasePeer.doDelete(BasePeer.java:530)
	at org.apache.torque.util.BasePeer.doDelete(BasePeer.java:446)
	at
com.ericsson.esb.sms.om.BaseKeyword2Peer.doDelete(BaseKeyword2Peer.java:505)
[...]	

I've checked out BasePeer's source code, and line 530 is:

ColumnMap[] columnMaps = dbMap.getTable(tab).getColumns();


Looking around, on some other post, someone mentions the problem and said that
they had to modify Torque's source because somehow the map was becoming null,
so he manually initialized dbMap every time it was called in the code :o .
Still, this solution doesn't sound right, given how well Torque normally works.
On some other post
(http://wiki.apache.org/db-torque/FrequentlyAskedQuestions#head-741b057263b7493fb0461d011753bc01d5967742)
I read that certain exceptions could arise from trying to delete records from a
table with no primary key. I thought this was it (my table had no primary key),
however, I after including a primary key I am still getting the same error. 

I am attaching the table schema:

	<table name="keyword2" idMethod="native">
		<column name="ID" type="INTEGER" size="11" required="true" primaryKey="true" 
autoIncrement="true"/>		
		<column name="KEYWORD" type="VARCHAR" size="160" required="true"/>
		<column name="CONTENT" type="VARCHAR" size="255" default=""/>
		<column name="PARAM" type="VARCHAR" size="255" default=""/>
        <column name="COMMMETHOD" required="true" type="VARCHAR" size="30" />
        <unique>
            <unique-column name="KEYWORD"/>
            <unique-column name="COMMMETHOD"/>
        </unique>
    </table>

I am using Torque 3.1 and MySQL 4.0.18 (using them under Jetspeed 1.5, but I
don't think this has anything to do with it). The strange part is that I can do
Selects and Inserts on this table with no problem, and I can do Deletes on all
my other tables as well...  Any hints?

Regards
Ruy


		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


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


Mime
View raw message