Changeset 360 for trunk/grails-app/services/AssetService.groovy
- Timestamp:
- Feb 16, 2010, 10:02:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/AssetService.groovy
r352 r360 47 47 r = assetSubItemService.delete(id: assetSubItem.id) 48 48 if(r.error) { 49 log.debug r.error 49 50 fail(code:"asset.subItems.delete.failure") 50 51 break … … 56 57 return result 57 58 58 try {59 result.assetInstance.delete(flush:true)60 return result //Success.61 }62 catch(org.springframework.dao.DataIntegrityViolationException e) {63 return fail(code:"default.delete.failure")64 }59 // Success. 60 // We have handled all the foreign keys so the delete should go forward. 61 // Can't flush here due to cascading from Section and Site. 62 // And without flush there is no point it trying to catch the dao.DataIntegrityViolationException 63 // since that will only happen after leaving the transaction. 64 result.assetInstance.delete() 65 return result 65 66 66 67 } // end withTransaction
Note: See TracChangeset
for help on using the changeset viewer.