Revision problem

I am getting this exception while invoking deleteContentRelations.

2010-11-10 16:45:42,182 INFO [STDOUT] java.lang.IllegalArgumentException: The r evision ‘4’ does not specify the edit revision for the item with content id ‘28, 993’ but the user ‘manvinder.singh’ has the item checked out.
2010-11-10 16:45:42,183 INFO [STDOUT] at com.percussion.webservices.PSWebservi ceUtils.handleRevision(Unknown Source)
2010-11-10 16:45:42,183 INFO [STDOUT] at com.percussion.webservices.PSWebservi ceUtils.validateItemCheckoutByUser(Unknown Source)
2010-11-10 16:45:42,183 INFO [STDOUT] at com.percussion.webservices.PSWebservi ceUtils.deleteRelationships(Unknown Source)
2010-11-10 16:45:42,183 INFO [STDOUT] at com.percussion.webservices.content.im pl.PSContentWs.deleteContentRelations(Unknown Source)
2010-11-10 16:45:42,183 INFO [STDOUT] at com.gsa.usagov.util.GSAUtil.deleteAll LinksFromSlot(GSAUtil.java:1819)

I do have the item set to prepareForEdit.

thanks
Manvinder

This error message indicates the specified relationship contains older revision (but not the ‘edit’ revision). You may need to change the calling sequence.
For example, try the following:

(1) prepareForEdit
(2) get the links of the item
(3) call deleteContentRelations()