[ http://jira.dspace.org/jira/browse/DS-633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Wood resolved DS-633. -------------------------- Resolution: Fixed No comments for a week. Committed revision 5241. > NPE when deleting object returned by EPerson.findAll() > ------------------------------------------------------ > > Key: DS-633 > URL: http://jira.dspace.org/jira/browse/DS-633 > Project: DSpace 1.x > Issue Type: Bug > Components: DSpace API > Affects Versions: 1.6.2, 1.7 > Reporter: Mark Wood > Assignee: Mark Wood > Priority: Critical > Fix For: 1.7 > > Attachments: DatabaseManager.patch, EPerson.patch > > > While building a test tool to purge all users from the database, I ran into > persistent NPEs on EPerson.delete(). This seems to result from > EPerson.findAll() using DatabaseManager.query(), which does not set the table > type into the returned TableRowIterator. DatabaseManager.delete() needs to > know the table type in order to look up the table's primary key. Kaboom. > It appears that query() is meant for use with queries whose result is not a > base table type (JOINs and the like). For a simple SELECT * FROM table... it > seems that queryTable() should be used. The attachment EPerson.patch makes > this change everywhere in EPerson that it seems to be appropriate and is > observed to eliminate the NPEs in this specific case. (The patch also tidies > some comments.) > The attachment DatabaseManager.patch is to defend against deletion of untyped > rows and throw a more descriptive exception. The class might benefit from > more extensive antibugging work. This patch is not essential but might be > helpful in similar circumstances. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.dspace.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ Dspace-devel mailing list Dspace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-devel