Bugs item #1550456, was opened at 2006-09-01 05:52
Message generated for change (Settings changed) made by tdonohue
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=119984&aid=1550456&group_id=19984

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: DBMS
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
Submitted By: Richard Jones (richard-jones)
Assigned to: Nobody/Anonymous (nobody)
Summary: TableRow doesn't contain table name in some cases

Initial Comment:
The following use of the DatabaseManager, 
TableRowIterator, and TableRow will cause an NPE:

Object[] params = { new Integer(id) };
TableRowIterator tri = 
     DatabaseManager.query(context, someQuery, params);

while (tri.hasNext())
{
  row = tri.next();
  row.setColumn("my_column", someValue);
  DatabaseManager.update(context, row);
}

Such that:

java.lang.NullPointerException
        at 
org.dspace.storage.rdbms.DatabaseManager.retrieveColumnInfo(DatabaseManager.java:1527)
        at 
org.dspace.storage.rdbms.DatabaseManager.getColumnInfoInternal(DatabaseManager.java:1498)
        at 
org.dspace.storage.rdbms.DatabaseManager.getColumnInfo(DatabaseManager.java:890)
        at 
org.dspace.storage.rdbms.DatabaseManager.getPrimaryKeyColumnInfo(DatabaseManager.java:1348)
        at 
org.dspace.storage.rdbms.DatabaseManager.update(DatabaseManager.java:838)

This appears to be because the operation:

row.getTable()

returns null when the query method of DatabaseManager 
with the signature as above is used to generate the 
row.  The TableRowIterator generated by this query 
method holds the value of the table as null, and 
propagates this into each TableRow object that it 
generates when next() is called.

There is no obvious workaround in implementing code.

----------------------------------------------------------------------

Comment By: Richard Jones (richard-jones)
Date: 2006-09-01 06:04

Message:
Logged In: YES 
user_id=1021756

Actually, there is an alternative to use queryTable, which 
does work.

So does this technically count as a bug?  It was not 
immediately clear what the problem was, or what the 
solution might be

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=119984&aid=1550456&group_id=19984

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to