[ 
https://jira.duraspace.org/browse/DS-633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mark H. Wood closed DS-633.
---------------------------


> NPE when deleting object returned by EPerson.findAll()
> ------------------------------------------------------
>
>                 Key: DS-633
>                 URL: https://jira.duraspace.org/browse/DS-633
>             Project: DSpace
>          Issue Type: Bug
>          Components: DSpace API
>    Affects Versions: 1.6.2, 1.7.0
>            Reporter: Mark H. Wood
>            Assignee: Mark H. Wood
>            Priority: Critical
>             Fix For: 1.7.0
>
>         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: 
https://jira.duraspace.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to