Ignore:
Timestamp:
Nov 2, 2009, 3:25:26 PM (15 years ago)
Author:
gav
Message:

Resolve ticket #12 again.
Turn query cache on again since this did not resolve the problem.
Implement fix as per http://jira.codehaus.org/browse/GRAILS-5111, add flush:true to save.
Adjust templates to include above and remove home url.
Re-generate all non detailed views and controllers.
Manually add flush:true and remove home url to detailed views and controllers.

Location:
trunk/grails-app/controllers
Files:
54 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AppCoreController.groovy

    r150 r178  
    3636            def personInstance = Person.get(authenticateService.userDomain().id)
    3737                personInstance.properties = params
    38                 if (!personInstance.hasErrors() && personInstance.save()) {
     38                if (!personInstance.hasErrors() && personInstance.save(flush: true)) {
    3939                    def sess = getSession()
    4040                    sess.setMaxInactiveInterval(personInstance.sessionTimeout)
     
    6464                personInstance.password = authenticateService.encodePassword(personInstance.pass)
    6565
    66                 if (!personInstance.hasErrors() && personInstance.save()) {
     66                if (!personInstance.hasErrors() && personInstance.save(flush: true)) {
    6767                    //userCache.removeUserFromCache(personInstance.loginName)
    6868                    flash.message = "Password changed successfully."
  • trunk/grails-app/controllers/AssemblyController.groovy

    r118 r178  
    2727        if(assemblyInstance) {
    2828            try {
    29                 assemblyInstance.delete()
     29                assemblyInstance.delete(flush:true)
    3030                flash.message = "Assembly ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            assemblyInstance.properties = params
    69             if(!assemblyInstance.hasErrors() && assemblyInstance.save()) {
     69            if(!assemblyInstance.hasErrors() && assemblyInstance.save(flush: true)) {
    7070                flash.message = "Assembly ${params.id} updated"
    7171                redirect(action:show,id:assemblyInstance.id)
     
    7777        else {
    7878            flash.message = "Assembly not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def assemblyInstance = new Assembly(params)
    91         if(!assemblyInstance.hasErrors() && assemblyInstance.save()) {
     91        if(!assemblyInstance.hasErrors() && assemblyInstance.save(flush: true)) {
    9292            flash.message = "Assembly ${assemblyInstance.id} created"
    9393            redirect(action:show,id:assemblyInstance.id)
  • trunk/grails-app/controllers/AssetController.groovy

    r161 r178  
    6767            }
    6868            assetInstance.properties = params
    69             if(!assetInstance.hasErrors() && assetInstance.save()) {
     69            if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) {
    7070                flash.message = "Asset ${params.id} updated"
    7171                redirect(action:show,id:assetInstance.id)
     
    8989    def save = {
    9090        def assetInstance = new Asset(params)
    91         if(!assetInstance.hasErrors() && assetInstance.save()) {
     91        if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) {
    9292            flash.message = "Asset ${assetInstance.id} created"
    9393            redirect(action:show,id:assetInstance.id)
  • trunk/grails-app/controllers/AssetDetailedController.groovy

    r161 r178  
    9393            }
    9494            assetInstance.properties = params
    95             if(!assetInstance.hasErrors() && assetInstance.save()) {
     95            if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) {
    9696                flash.message = "Asset ${params.id} updated"
    9797                redirect(action:show,id:assetInstance.id)
     
    115115    def save = {
    116116        def assetInstance = new Asset(params)
    117         if(!assetInstance.hasErrors() && assetInstance.save()) {
     117        if(!assetInstance.hasErrors() && assetInstance.save(flush: true)) {
    118118            flash.message = "Asset ${assetInstance.id} created"
    119119            redirect(action:show,id:assetInstance.id)
  • trunk/grails-app/controllers/AssetExtendedAttributeController.groovy

    r122 r178  
    2727        if(assetExtendedAttributeInstance) {
    2828            try {
    29                 assetExtendedAttributeInstance.delete()
     29                assetExtendedAttributeInstance.delete(flush:true)
    3030                flash.message = "AssetExtendedAttribute ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            assetExtendedAttributeInstance.properties = params
    69             if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save()) {
     69            if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save(flush: true)) {
    7070                flash.message = "AssetExtendedAttribute ${params.id} updated"
    7171                redirect(action:show,id:assetExtendedAttributeInstance.id)
     
    7777        else {
    7878            flash.message = "AssetExtendedAttribute not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def assetExtendedAttributeInstance = new AssetExtendedAttribute(params)
    91         if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save()) {
     91        if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save(flush: true)) {
    9292            flash.message = "AssetExtendedAttribute ${assetExtendedAttributeInstance.id} created"
    9393            redirect(action:show,id:assetExtendedAttributeInstance.id)
  • trunk/grails-app/controllers/AssetExtendedAttributeDetailedController.groovy

    r124 r178  
    6767            }
    6868            assetExtendedAttributeInstance.properties = params
    69             if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save()) {
     69            if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save(flush: true)) {
    7070                flash.message = "AssetExtendedAttribute ${params.id} updated"
    7171                redirect(action:show,id:assetExtendedAttributeInstance.id)
     
    8989    def save = {
    9090        def assetExtendedAttributeInstance = new AssetExtendedAttribute(params)
    91         if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save()) {
     91        if(!assetExtendedAttributeInstance.hasErrors() && assetExtendedAttributeInstance.save(flush: true)) {
    9292            flash.message = "AssetExtendedAttribute ${assetExtendedAttributeInstance.id} created"
    9393            redirect(action:show,id:assetExtendedAttributeInstance.id)
  • trunk/grails-app/controllers/AssetExtendedAttributeTypeController.groovy

    r122 r178  
    2727        if(assetExtendedAttributeTypeInstance) {
    2828            try {
    29                 assetExtendedAttributeTypeInstance.delete()
     29                assetExtendedAttributeTypeInstance.delete(flush:true)
    3030                flash.message = "AssetExtendedAttributeType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            assetExtendedAttributeTypeInstance.properties = params
    69             if(!assetExtendedAttributeTypeInstance.hasErrors() && assetExtendedAttributeTypeInstance.save()) {
     69            if(!assetExtendedAttributeTypeInstance.hasErrors() && assetExtendedAttributeTypeInstance.save(flush: true)) {
    7070                flash.message = "AssetExtendedAttributeType ${params.id} updated"
    7171                redirect(action:show,id:assetExtendedAttributeTypeInstance.id)
     
    7777        else {
    7878            flash.message = "AssetExtendedAttributeType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def assetExtendedAttributeTypeInstance = new AssetExtendedAttributeType(params)
    91         if(!assetExtendedAttributeTypeInstance.hasErrors() && assetExtendedAttributeTypeInstance.save()) {
     91        if(!assetExtendedAttributeTypeInstance.hasErrors() && assetExtendedAttributeTypeInstance.save(flush: true)) {
    9292            flash.message = "AssetExtendedAttributeType ${assetExtendedAttributeTypeInstance.id} created"
    9393            redirect(action:show,id:assetExtendedAttributeTypeInstance.id)
  • trunk/grails-app/controllers/AssetTypeController.groovy

    r160 r178  
    6767            }
    6868            assetTypeInstance.properties = params
    69             if(!assetTypeInstance.hasErrors() && assetTypeInstance.save()) {
     69            if(!assetTypeInstance.hasErrors() && assetTypeInstance.save(flush: true)) {
    7070                flash.message = "AssetType ${params.id} updated"
    7171                redirect(action:show,id:assetTypeInstance.id)
     
    8989    def save = {
    9090        def assetTypeInstance = new AssetType(params)
    91         if(!assetTypeInstance.hasErrors() && assetTypeInstance.save()) {
     91        if(!assetTypeInstance.hasErrors() && assetTypeInstance.save(flush: true)) {
    9292            flash.message = "AssetType ${assetTypeInstance.id} created"
    9393            redirect(action:show,id:assetTypeInstance.id)
  • trunk/grails-app/controllers/AssignedPersonController.groovy

    r96 r178  
    2727        if(assignedPersonInstance) {
    2828            try {
    29                 assignedPersonInstance.delete()
     29                assignedPersonInstance.delete(flush:true)
    3030                flash.message = "AssignedPerson ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            assignedPersonInstance.properties = params
    69             if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save()) {
     69            if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save(flush: true)) {
    7070                flash.message = "AssignedPerson ${params.id} updated"
    7171                redirect(action:show,id:assignedPersonInstance.id)
     
    7777        else {
    7878            flash.message = "AssignedPerson not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def assignedPersonInstance = new AssignedPerson(params)
    91         if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save()) {
     91        if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save(flush: true)) {
    9292            flash.message = "AssignedPerson ${assignedPersonInstance.id} created"
    9393            redirect(action:show,id:assignedPersonInstance.id)
  • trunk/grails-app/controllers/AssignedPersonDetailedController.groovy

    r147 r178  
    6868            }
    6969            assignedPersonInstance.properties = params
    70             if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save()) {
     70            if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save(flush: true)) {
    7171                flash.message = "AssignedPerson ${params.id} updated"
    7272                redirect(action:show,id:assignedPersonInstance.id)
     
    9797        def assignedPersonInstance = new AssignedPerson(params)
    9898
    99         if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save()) {
     99        if(!assignedPersonInstance.hasErrors() && assignedPersonInstance.save(flush: true)) {
    100100            flash.message = "AssignedPerson ${assignedPersonInstance.id} created"
    101101            redirect(controller:"taskDetailed", action:"show", id: params.task.id)
  • trunk/grails-app/controllers/AuthorityController.groovy

    r150 r178  
    110110        def authority = new Authority()
    111111        authority.properties = params
    112         if (authority.save()) {
     112        if (authority.save(flush: true)) {
    113113            redirect action: show, id: authority.id
    114114        }
  • trunk/grails-app/controllers/ComponentItemController.groovy

    r118 r178  
    2727        if(componentItemInstance) {
    2828            try {
    29                 componentItemInstance.delete()
     29                componentItemInstance.delete(flush:true)
    3030                flash.message = "ComponentItem ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            componentItemInstance.properties = params
    69             if(!componentItemInstance.hasErrors() && componentItemInstance.save()) {
     69            if(!componentItemInstance.hasErrors() && componentItemInstance.save(flush: true)) {
    7070                flash.message = "ComponentItem ${params.id} updated"
    7171                redirect(action:show,id:componentItemInstance.id)
     
    7777        else {
    7878            flash.message = "ComponentItem not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def componentItemInstance = new ComponentItem(params)
    91         if(!componentItemInstance.hasErrors() && componentItemInstance.save()) {
     91        if(!componentItemInstance.hasErrors() && componentItemInstance.save(flush: true)) {
    9292            flash.message = "ComponentItem ${componentItemInstance.id} created"
    9393            redirect(action:show,id:componentItemInstance.id)
  • trunk/grails-app/controllers/DepartmentController.groovy

    r162 r178  
    6767            }
    6868            departmentInstance.properties = params
    69             if(!departmentInstance.hasErrors() && departmentInstance.save()) {
     69            if(!departmentInstance.hasErrors() && departmentInstance.save(flush: true)) {
    7070                flash.message = "Department ${params.id} updated"
    7171                redirect(action:show,id:departmentInstance.id)
     
    8989    def save = {
    9090        def departmentInstance = new Department(params)
    91         if(!departmentInstance.hasErrors() && departmentInstance.save()) {
     91        if(!departmentInstance.hasErrors() && departmentInstance.save(flush: true)) {
    9292            flash.message = "Department ${departmentInstance.id} created"
    9393            redirect(action:show,id:departmentInstance.id)
  • trunk/grails-app/controllers/EntryController.groovy

    r122 r178  
    2727        if(entryInstance) {
    2828            try {
    29                 entryInstance.delete()
     29                entryInstance.delete(flush:true)
    3030                flash.message = "Entry ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            entryInstance.properties = params
    69             if(!entryInstance.hasErrors() && entryInstance.save()) {
     69            if(!entryInstance.hasErrors() && entryInstance.save(flush: true)) {
    7070                flash.message = "Entry ${params.id} updated"
    7171                redirect(action:show,id:entryInstance.id)
     
    7777        else {
    7878            flash.message = "Entry not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def entryInstance = new Entry(params)
    91         if(!entryInstance.hasErrors() && entryInstance.save()) {
     91        if(!entryInstance.hasErrors() && entryInstance.save(flush: true)) {
    9292            flash.message = "Entry ${entryInstance.id} created"
    9393            redirect(action:show,id:entryInstance.id)
  • trunk/grails-app/controllers/EntryDetailedController.groovy

    r147 r178  
    6868        if(entryInstance) {
    6969            entryInstance.properties = params
    70             if(!entryInstance.hasErrors() && entryInstance.save()) {
     70            if(!entryInstance.hasErrors() && entryInstance.save(flush: true)) {
    7171                flash.message = "Entry ${params.id} updated"
    7272                redirect(action:show,id:entryInstance.id)
     
    9999
    100100        entryInstance.enteredBy = Person.get(authenticateService.userDomain().id)
    101         if(!entryInstance.hasErrors() && entryInstance.save()) {
     101        if(!entryInstance.hasErrors() && entryInstance.save(flush: true)) {
    102102            flash.message = "Entry ${entryInstance.id} created"
    103103            redirect(controller:"taskDetailed", action:"show", id: params.task.id)
  • trunk/grails-app/controllers/EntryTypeController.groovy

    r122 r178  
    2727        if(entryTypeInstance) {
    2828            try {
    29                 entryTypeInstance.delete()
     29                entryTypeInstance.delete(flush:true)
    3030                flash.message = "EntryType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            entryTypeInstance.properties = params
    69             if(!entryTypeInstance.hasErrors() && entryTypeInstance.save()) {
     69            if(!entryTypeInstance.hasErrors() && entryTypeInstance.save(flush: true)) {
    7070                flash.message = "EntryType ${params.id} updated"
    7171                redirect(action:show,id:entryTypeInstance.id)
     
    7777        else {
    7878            flash.message = "EntryType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def entryTypeInstance = new EntryType(params)
    91         if(!entryTypeInstance.hasErrors() && entryTypeInstance.save()) {
     91        if(!entryTypeInstance.hasErrors() && entryTypeInstance.save(flush: true)) {
    9292            flash.message = "EntryType ${entryTypeInstance.id} created"
    9393            redirect(action:show,id:entryTypeInstance.id)
  • trunk/grails-app/controllers/InventoryGroupController.groovy

    r116 r178  
    2727        if(inventoryGroupInstance) {
    2828            try {
    29                 inventoryGroupInstance.delete()
     29                inventoryGroupInstance.delete(flush:true)
    3030                flash.message = "InventoryGroup ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            inventoryGroupInstance.properties = params
    69             if(!inventoryGroupInstance.hasErrors() && inventoryGroupInstance.save()) {
     69            if(!inventoryGroupInstance.hasErrors() && inventoryGroupInstance.save(flush: true)) {
    7070                flash.message = "InventoryGroup ${params.id} updated"
    7171                redirect(action:show,id:inventoryGroupInstance.id)
     
    7777        else {
    7878            flash.message = "InventoryGroup not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def inventoryGroupInstance = new InventoryGroup(params)
    91         if(!inventoryGroupInstance.hasErrors() && inventoryGroupInstance.save()) {
     91        if(!inventoryGroupInstance.hasErrors() && inventoryGroupInstance.save(flush: true)) {
    9292            flash.message = "InventoryGroup ${inventoryGroupInstance.id} created"
    9393            redirect(action:show,id:inventoryGroupInstance.id)
  • trunk/grails-app/controllers/InventoryItemController.groovy

    r175 r178  
    6767            }
    6868            inventoryItemInstance.properties = params
    69             if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save()) {
     69            if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save(flush: true)) {
    7070                flash.message = "InventoryItem ${params.id} updated"
    7171                redirect(action:show,id:inventoryItemInstance.id)
     
    8989    def save = {
    9090        def inventoryItemInstance = new InventoryItem(params)
    91         if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save()) {
     91        if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save(flush: true)) {
    9292            flash.message = "InventoryItem ${inventoryItemInstance.id} created"
    9393            redirect(action:show,id:inventoryItemInstance.id)
  • trunk/grails-app/controllers/InventoryItemDetailedController.groovy

    r175 r178  
    2020        // Quick Search:
    2121        if(!params.filter) {
    22             return[ inventoryItemInstanceList: InventoryItem.list( params ), inventoryItemInstanceTotal: InventoryItem.count() ]
     22            return[ inventoryItemInstanceList: InventoryItem.list( params ), inventoryItemInstanceTotal: InventoryItem.count(), filterParams: params ]
    2323        }
    2424        // filterPane:
     
    9393            }
    9494            inventoryItemInstance.properties = params
    95             if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save()) {
     95            if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save(flush: true)) {
    9696                flash.message = "InventoryItem ${params.id} updated"
    9797                redirect(action:show,id:inventoryItemInstance.id)
     
    115115    def save = {
    116116        def inventoryItemInstance = new InventoryItem(params)
    117         if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save()) {
     117        if(!inventoryItemInstance.hasErrors() && inventoryItemInstance.save(flush: true)) {
    118118            flash.message = "InventoryItem ${inventoryItemInstance.id} created"
    119119            redirect(action:show,id:inventoryItemInstance.id)
  • trunk/grails-app/controllers/InventoryLocationController.groovy

    r175 r178  
    6767            }
    6868            inventoryLocationInstance.properties = params
    69             if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save()) {
     69            if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save(flush: true)) {
    7070                flash.message = "InventoryLocation ${params.id} updated"
    7171                redirect(action:show,id:inventoryLocationInstance.id)
     
    8989    def save = {
    9090        def inventoryLocationInstance = new InventoryLocation(params)
    91         if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save()) {
     91        if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save(flush: true)) {
    9292            flash.message = "InventoryLocation ${inventoryLocationInstance.id} created"
    9393            redirect(action:show,id:inventoryLocationInstance.id)
  • trunk/grails-app/controllers/InventoryLocationDetailedController.groovy

    r175 r178  
    6767            }
    6868            inventoryLocationInstance.properties = params
    69             if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save()) {
     69            if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save(flush: true)) {
    7070                flash.message = "InventoryLocation ${params.id} updated"
    7171                redirect(action:show,id:inventoryLocationInstance.id)
     
    8989    def save = {
    9090        def inventoryLocationInstance = new InventoryLocation(params)
    91         if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save()) {
     91        if(!inventoryLocationInstance.hasErrors() && inventoryLocationInstance.save(flush: true)) {
    9292            flash.message = "InventoryLocation ${inventoryLocationInstance.id} created"
    9393            redirect(action:show,id:inventoryLocationInstance.id)
  • trunk/grails-app/controllers/InventoryMovementController.groovy

    r175 r178  
    6767            }
    6868            inventoryMovementInstance.properties = params
    69             if(!inventoryMovementInstance.hasErrors() && inventoryMovementInstance.save()) {
     69            if(!inventoryMovementInstance.hasErrors() && inventoryMovementInstance.save(flush: true)) {
    7070                flash.message = "InventoryMovement ${params.id} updated"
    7171                redirect(action:show,id:inventoryMovementInstance.id)
     
    8989    def save = {
    9090        def inventoryMovementInstance = new InventoryMovement(params)
    91         if(!inventoryMovementInstance.hasErrors() && inventoryMovementInstance.save()) {
     91        if(!inventoryMovementInstance.hasErrors() && inventoryMovementInstance.save(flush: true)) {
    9292            flash.message = "InventoryMovement ${inventoryMovementInstance.id} created"
    9393            redirect(action:show,id:inventoryMovementInstance.id)
  • trunk/grails-app/controllers/InventoryMovementTypeController.groovy

    r177 r178  
    6767            }
    6868            inventoryMovementTypeInstance.properties = params
    69             if(!inventoryMovementTypeInstance.hasErrors() && inventoryMovementTypeInstance.save()) {
     69            if(!inventoryMovementTypeInstance.hasErrors() && inventoryMovementTypeInstance.save(flush: true)) {
    7070                flash.message = "InventoryMovementType ${params.id} updated"
    7171                redirect(action:show,id:inventoryMovementTypeInstance.id)
     
    8989    def save = {
    9090        def inventoryMovementTypeInstance = new InventoryMovementType(params)
    91         if(!inventoryMovementTypeInstance.hasErrors() && inventoryMovementTypeInstance.save()) {
     91        if(!inventoryMovementTypeInstance.hasErrors() && inventoryMovementTypeInstance.save(flush: true)) {
    9292            flash.message = "InventoryMovementType ${inventoryMovementTypeInstance.id} created"
    9393            redirect(action:show,id:inventoryMovementTypeInstance.id)
  • trunk/grails-app/controllers/InventoryStoreController.groovy

    r175 r178  
    6767            }
    6868            inventoryStoreInstance.properties = params
    69             if(!inventoryStoreInstance.hasErrors() && inventoryStoreInstance.save()) {
     69            if(!inventoryStoreInstance.hasErrors() && inventoryStoreInstance.save(flush: true)) {
    7070                flash.message = "InventoryStore ${params.id} updated"
    7171                redirect(action:show,id:inventoryStoreInstance.id)
     
    8989    def save = {
    9090        def inventoryStoreInstance = new InventoryStore(params)
    91         if(!inventoryStoreInstance.hasErrors() && inventoryStoreInstance.save()) {
     91        if(!inventoryStoreInstance.hasErrors() && inventoryStoreInstance.save(flush: true)) {
    9292            flash.message = "InventoryStore ${inventoryStoreInstance.id} created"
    9393            redirect(action:show,id:inventoryStoreInstance.id)
  • trunk/grails-app/controllers/InventoryTypeController.groovy

    r116 r178  
    2727        if(inventoryTypeInstance) {
    2828            try {
    29                 inventoryTypeInstance.delete()
     29                inventoryTypeInstance.delete(flush:true)
    3030                flash.message = "InventoryType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            inventoryTypeInstance.properties = params
    69             if(!inventoryTypeInstance.hasErrors() && inventoryTypeInstance.save()) {
     69            if(!inventoryTypeInstance.hasErrors() && inventoryTypeInstance.save(flush: true)) {
    7070                flash.message = "InventoryType ${params.id} updated"
    7171                redirect(action:show,id:inventoryTypeInstance.id)
     
    7777        else {
    7878            flash.message = "InventoryType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def inventoryTypeInstance = new InventoryType(params)
    91         if(!inventoryTypeInstance.hasErrors() && inventoryTypeInstance.save()) {
     91        if(!inventoryTypeInstance.hasErrors() && inventoryTypeInstance.save(flush: true)) {
    9292            flash.message = "InventoryType ${inventoryTypeInstance.id} created"
    9393            redirect(action:show,id:inventoryTypeInstance.id)
  • trunk/grails-app/controllers/LifePlanController.groovy

    r118 r178  
    2727        if(lifePlanInstance) {
    2828            try {
    29                 lifePlanInstance.delete()
     29                lifePlanInstance.delete(flush:true)
    3030                flash.message = "LifePlan ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            lifePlanInstance.properties = params
    69             if(!lifePlanInstance.hasErrors() && lifePlanInstance.save()) {
     69            if(!lifePlanInstance.hasErrors() && lifePlanInstance.save(flush: true)) {
    7070                flash.message = "LifePlan ${params.id} updated"
    7171                redirect(action:show,id:lifePlanInstance.id)
     
    7777        else {
    7878            flash.message = "LifePlan not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def lifePlanInstance = new LifePlan(params)
    91         if(!lifePlanInstance.hasErrors() && lifePlanInstance.save()) {
     91        if(!lifePlanInstance.hasErrors() && lifePlanInstance.save(flush: true)) {
    9292            flash.message = "LifePlan ${lifePlanInstance.id} created"
    9393            redirect(action:show,id:lifePlanInstance.id)
  • trunk/grails-app/controllers/MaintenanceActionController.groovy

    r131 r178  
    2727        if(maintenanceActionInstance) {
    2828            try {
    29                 maintenanceActionInstance.delete()
     29                maintenanceActionInstance.delete(flush:true)
    3030                flash.message = "MaintenanceAction ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            maintenanceActionInstance.properties = params
    69             if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save()) {
     69            if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save(flush: true)) {
    7070                flash.message = "MaintenanceAction ${params.id} updated"
    7171                redirect(action:show,id:maintenanceActionInstance.id)
     
    7777        else {
    7878            flash.message = "MaintenanceAction not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def maintenanceActionInstance = new MaintenanceAction(params)
    91         if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save()) {
     91        if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save(flush: true)) {
    9292            flash.message = "MaintenanceAction ${maintenanceActionInstance.id} created"
    9393            redirect(action:show,id:maintenanceActionInstance.id)
  • trunk/grails-app/controllers/MaintenanceActionDetailedController.groovy

    r133 r178  
    6767            }
    6868            maintenanceActionInstance.properties = params
    69             if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save()) {
     69            if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save(flush: true)) {
    7070                flash.message = "MaintenanceAction ${params.id} updated"
    7171                redirect(action:show,id:maintenanceActionInstance.id)
     
    8989    def save = {
    9090        def maintenanceActionInstance = new MaintenanceAction(params)
    91         if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save()) {
     91        if(!maintenanceActionInstance.hasErrors() && maintenanceActionInstance.save(flush: true)) {
    9292            flash.message = "MaintenanceAction ${maintenanceActionInstance.id} created"
    9393            redirect(action:show,id:maintenanceActionInstance.id)
  • trunk/grails-app/controllers/MaintenancePolicyController.groovy

    r122 r178  
    2727        if(maintenancePolicyInstance) {
    2828            try {
    29                 maintenancePolicyInstance.delete()
     29                maintenancePolicyInstance.delete(flush:true)
    3030                flash.message = "MaintenancePolicy ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            maintenancePolicyInstance.properties = params
    69             if(!maintenancePolicyInstance.hasErrors() && maintenancePolicyInstance.save()) {
     69            if(!maintenancePolicyInstance.hasErrors() && maintenancePolicyInstance.save(flush: true)) {
    7070                flash.message = "MaintenancePolicy ${params.id} updated"
    7171                redirect(action:show,id:maintenancePolicyInstance.id)
     
    7777        else {
    7878            flash.message = "MaintenancePolicy not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def maintenancePolicyInstance = new MaintenancePolicy(params)
    91         if(!maintenancePolicyInstance.hasErrors() && maintenancePolicyInstance.save()) {
     91        if(!maintenancePolicyInstance.hasErrors() && maintenancePolicyInstance.save(flush: true)) {
    9292            flash.message = "MaintenancePolicy ${maintenancePolicyInstance.id} created"
    9393            redirect(action:show,id:maintenancePolicyInstance.id)
  • trunk/grails-app/controllers/ManufacturerController.groovy

    r116 r178  
    2727        if(manufacturerInstance) {
    2828            try {
    29                 manufacturerInstance.delete()
     29                manufacturerInstance.delete(flush:true)
    3030                flash.message = "Manufacturer ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            manufacturerInstance.properties = params
    69             if(!manufacturerInstance.hasErrors() && manufacturerInstance.save()) {
     69            if(!manufacturerInstance.hasErrors() && manufacturerInstance.save(flush: true)) {
    7070                flash.message = "Manufacturer ${params.id} updated"
    7171                redirect(action:show,id:manufacturerInstance.id)
     
    7777        else {
    7878            flash.message = "Manufacturer not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def manufacturerInstance = new Manufacturer(params)
    91         if(!manufacturerInstance.hasErrors() && manufacturerInstance.save()) {
     91        if(!manufacturerInstance.hasErrors() && manufacturerInstance.save(flush: true)) {
    9292            flash.message = "Manufacturer ${manufacturerInstance.id} created"
    9393            redirect(action:show,id:manufacturerInstance.id)
  • trunk/grails-app/controllers/ManufacturerTypeController.groovy

    r116 r178  
    2727        if(manufacturerTypeInstance) {
    2828            try {
    29                 manufacturerTypeInstance.delete()
     29                manufacturerTypeInstance.delete(flush:true)
    3030                flash.message = "ManufacturerType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            manufacturerTypeInstance.properties = params
    69             if(!manufacturerTypeInstance.hasErrors() && manufacturerTypeInstance.save()) {
     69            if(!manufacturerTypeInstance.hasErrors() && manufacturerTypeInstance.save(flush: true)) {
    7070                flash.message = "ManufacturerType ${params.id} updated"
    7171                redirect(action:show,id:manufacturerTypeInstance.id)
     
    7777        else {
    7878            flash.message = "ManufacturerType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def manufacturerTypeInstance = new ManufacturerType(params)
    91         if(!manufacturerTypeInstance.hasErrors() && manufacturerTypeInstance.save()) {
     91        if(!manufacturerTypeInstance.hasErrors() && manufacturerTypeInstance.save(flush: true)) {
    9292            flash.message = "ManufacturerType ${manufacturerTypeInstance.id} created"
    9393            redirect(action:show,id:manufacturerTypeInstance.id)
  • trunk/grails-app/controllers/PeriodController.groovy

    r122 r178  
    2727        if(periodInstance) {
    2828            try {
    29                 periodInstance.delete()
     29                periodInstance.delete(flush:true)
    3030                flash.message = "Period ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            periodInstance.properties = params
    69             if(!periodInstance.hasErrors() && periodInstance.save()) {
     69            if(!periodInstance.hasErrors() && periodInstance.save(flush: true)) {
    7070                flash.message = "Period ${params.id} updated"
    7171                redirect(action:show,id:periodInstance.id)
     
    7777        else {
    7878            flash.message = "Period not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def periodInstance = new Period(params)
    91         if(!periodInstance.hasErrors() && periodInstance.save()) {
     91        if(!periodInstance.hasErrors() && periodInstance.save(flush: true)) {
    9292            flash.message = "Period ${periodInstance.id} created"
    9393            redirect(action:show,id:periodInstance.id)
  • trunk/grails-app/controllers/PersonController.groovy

    r150 r178  
    132132        }
    133133
    134         if (!person.hasErrors() && person.save()) {
     134        if (!person.hasErrors() && person.save(flush: true)) {
    135135            Authority.findAll().each { it.removeFromPersons(person) }
    136136            addRoles(person)
     
    157157        person.properties = params
    158158        person.password = authenticateService.encodePassword(params.pass)
    159         if (person.save()) {
     159        if (person.save(flush: true)) {
    160160            addRoles(person)
    161161            redirect action: show, id: person.id
  • trunk/grails-app/controllers/PersonGroupController.groovy

    r166 r178  
    6767            }
    6868            personGroupInstance.properties = params
    69             if(!personGroupInstance.hasErrors() && personGroupInstance.save()) {
     69            if(!personGroupInstance.hasErrors() && personGroupInstance.save(flush: true)) {
    7070                flash.message = "PersonGroup ${params.id} updated"
    7171                redirect(action:show,id:personGroupInstance.id)
     
    8989    def save = {
    9090        def personGroupInstance = new PersonGroup(params)
    91         if(!personGroupInstance.hasErrors() && personGroupInstance.save()) {
     91        if(!personGroupInstance.hasErrors() && personGroupInstance.save(flush: true)) {
    9292            flash.message = "PersonGroup ${personGroupInstance.id} created"
    9393            redirect(action:show,id:personGroupInstance.id)
  • trunk/grails-app/controllers/PersonGroupTypeController.groovy

    r122 r178  
    2727        if(personGroupTypeInstance) {
    2828            try {
    29                 personGroupTypeInstance.delete()
     29                personGroupTypeInstance.delete(flush:true)
    3030                flash.message = "PersonGroupType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            personGroupTypeInstance.properties = params
    69             if(!personGroupTypeInstance.hasErrors() && personGroupTypeInstance.save()) {
     69            if(!personGroupTypeInstance.hasErrors() && personGroupTypeInstance.save(flush: true)) {
    7070                flash.message = "PersonGroupType ${params.id} updated"
    7171                redirect(action:show,id:personGroupTypeInstance.id)
     
    7777        else {
    7878            flash.message = "PersonGroupType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def personGroupTypeInstance = new PersonGroupType(params)
    91         if(!personGroupTypeInstance.hasErrors() && personGroupTypeInstance.save()) {
     91        if(!personGroupTypeInstance.hasErrors() && personGroupTypeInstance.save(flush: true)) {
    9292            flash.message = "PersonGroupType ${personGroupTypeInstance.id} created"
    9393            redirect(action:show,id:personGroupTypeInstance.id)
  • trunk/grails-app/controllers/SiteController.groovy

    r163 r178  
    6767            }
    6868            siteInstance.properties = params
    69             if(!siteInstance.hasErrors() && siteInstance.save()) {
     69            if(!siteInstance.hasErrors() && siteInstance.save(flush: true)) {
    7070                flash.message = "Site ${params.id} updated"
    7171                redirect(action:show,id:siteInstance.id)
     
    8989    def save = {
    9090        def siteInstance = new Site(params)
    91         if(!siteInstance.hasErrors() && siteInstance.save()) {
     91        if(!siteInstance.hasErrors() && siteInstance.save(flush: true)) {
    9292            flash.message = "Site ${siteInstance.id} created"
    9393            redirect(action:show,id:siteInstance.id)
  • trunk/grails-app/controllers/SubAssemblyController.groovy

    r118 r178  
    2727        if(subAssemblyInstance) {
    2828            try {
    29                 subAssemblyInstance.delete()
     29                subAssemblyInstance.delete(flush:true)
    3030                flash.message = "SubAssembly ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            subAssemblyInstance.properties = params
    69             if(!subAssemblyInstance.hasErrors() && subAssemblyInstance.save()) {
     69            if(!subAssemblyInstance.hasErrors() && subAssemblyInstance.save(flush: true)) {
    7070                flash.message = "SubAssembly ${params.id} updated"
    7171                redirect(action:show,id:subAssemblyInstance.id)
     
    7777        else {
    7878            flash.message = "SubAssembly not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def subAssemblyInstance = new SubAssembly(params)
    91         if(!subAssemblyInstance.hasErrors() && subAssemblyInstance.save()) {
     91        if(!subAssemblyInstance.hasErrors() && subAssemblyInstance.save(flush: true)) {
    9292            flash.message = "SubAssembly ${subAssemblyInstance.id} created"
    9393            redirect(action:show,id:subAssemblyInstance.id)
  • trunk/grails-app/controllers/SupplierController.groovy

    r116 r178  
    2727        if(supplierInstance) {
    2828            try {
    29                 supplierInstance.delete()
     29                supplierInstance.delete(flush:true)
    3030                flash.message = "Supplier ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            supplierInstance.properties = params
    69             if(!supplierInstance.hasErrors() && supplierInstance.save()) {
     69            if(!supplierInstance.hasErrors() && supplierInstance.save(flush: true)) {
    7070                flash.message = "Supplier ${params.id} updated"
    7171                redirect(action:show,id:supplierInstance.id)
     
    7777        else {
    7878            flash.message = "Supplier not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def supplierInstance = new Supplier(params)
    91         if(!supplierInstance.hasErrors() && supplierInstance.save()) {
     91        if(!supplierInstance.hasErrors() && supplierInstance.save(flush: true)) {
    9292            flash.message = "Supplier ${supplierInstance.id} created"
    9393            redirect(action:show,id:supplierInstance.id)
  • trunk/grails-app/controllers/SupplierTypeController.groovy

    r116 r178  
    2727        if(supplierTypeInstance) {
    2828            try {
    29                 supplierTypeInstance.delete()
     29                supplierTypeInstance.delete(flush:true)
    3030                flash.message = "SupplierType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            supplierTypeInstance.properties = params
    69             if(!supplierTypeInstance.hasErrors() && supplierTypeInstance.save()) {
     69            if(!supplierTypeInstance.hasErrors() && supplierTypeInstance.save(flush: true)) {
    7070                flash.message = "SupplierType ${params.id} updated"
    7171                redirect(action:show,id:supplierTypeInstance.id)
     
    7777        else {
    7878            flash.message = "SupplierType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def supplierTypeInstance = new SupplierType(params)
    91         if(!supplierTypeInstance.hasErrors() && supplierTypeInstance.save()) {
     91        if(!supplierTypeInstance.hasErrors() && supplierTypeInstance.save(flush: true)) {
    9292            flash.message = "SupplierType ${supplierTypeInstance.id} created"
    9393            redirect(action:show,id:supplierTypeInstance.id)
  • trunk/grails-app/controllers/SystemSectionController.groovy

    r162 r178  
    6767            }
    6868            systemSectionInstance.properties = params
    69             if(!systemSectionInstance.hasErrors() && systemSectionInstance.save()) {
     69            if(!systemSectionInstance.hasErrors() && systemSectionInstance.save(flush: true)) {
    7070                flash.message = "SystemSection ${params.id} updated"
    7171                redirect(action:show,id:systemSectionInstance.id)
     
    8989    def save = {
    9090        def systemSectionInstance = new SystemSection(params)
    91         if(!systemSectionInstance.hasErrors() && systemSectionInstance.save()) {
     91        if(!systemSectionInstance.hasErrors() && systemSectionInstance.save(flush: true)) {
    9292            flash.message = "SystemSection ${systemSectionInstance.id} created"
    9393            redirect(action:show,id:systemSectionInstance.id)
  • trunk/grails-app/controllers/SystemSectionDetailedController.groovy

    r162 r178  
    6767            }
    6868            systemSectionInstance.properties = params
    69             if(!systemSectionInstance.hasErrors() && systemSectionInstance.save()) {
     69            if(!systemSectionInstance.hasErrors() && systemSectionInstance.save(flush: true)) {
    7070                flash.message = "SystemSection ${params.id} updated"
    7171                redirect(action:show,id:systemSectionInstance.id)
     
    8989    def save = {
    9090        def systemSectionInstance = new SystemSection(params)
    91         if(!systemSectionInstance.hasErrors() && systemSectionInstance.save()) {
     91        if(!systemSectionInstance.hasErrors() && systemSectionInstance.save(flush: true)) {
    9292            flash.message = "SystemSection ${systemSectionInstance.id} created"
    9393            redirect(action:show,id:systemSectionInstance.id)
  • trunk/grails-app/controllers/TaskController.groovy

    r96 r178  
    2727        if(taskInstance) {
    2828            try {
    29                 taskInstance.delete()
     29                taskInstance.delete(flush:true)
    3030                flash.message = "Task ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskInstance.properties = params
    69             if(!taskInstance.hasErrors() && taskInstance.save()) {
     69            if(!taskInstance.hasErrors() && taskInstance.save(flush: true)) {
    7070                flash.message = "Task ${params.id} updated"
    7171                redirect(action:show,id:taskInstance.id)
     
    7777        else {
    7878            flash.message = "Task not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskInstance = new Task(params)
    91         if(!taskInstance.hasErrors() && taskInstance.save()) {
     91        if(!taskInstance.hasErrors() && taskInstance.save(flush: true)) {
    9292            flash.message = "Task ${taskInstance.id} created"
    9393            redirect(action:show,id:taskInstance.id)
  • trunk/grails-app/controllers/TaskDetailedController.groovy

    r175 r178  
    275275            }
    276276            taskInstance.properties = params
    277             if(!taskInstance.hasErrors() && taskInstance.save()) {
     277            if(!taskInstance.hasErrors() && taskInstance.save(flush: true)) {
    278278                flash.message = "Task ${params.id} updated"
    279279                redirect(action:show,id:taskInstance.id)
     
    297297    def save = {
    298298        def taskInstance = new Task(params)
    299         if(!taskInstance.hasErrors() && taskInstance.save()) {
     299        if(!taskInstance.hasErrors() && taskInstance.save(flush: true)) {
    300300            flash.message = "Task ${taskInstance.id} created"
    301301            redirect(action:show,id:taskInstance.id)
  • trunk/grails-app/controllers/TaskGroupController.groovy

    r122 r178  
    2727        if(taskGroupInstance) {
    2828            try {
    29                 taskGroupInstance.delete()
     29                taskGroupInstance.delete(flush:true)
    3030                flash.message = "TaskGroup ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskGroupInstance.properties = params
    69             if(!taskGroupInstance.hasErrors() && taskGroupInstance.save()) {
     69            if(!taskGroupInstance.hasErrors() && taskGroupInstance.save(flush: true)) {
    7070                flash.message = "TaskGroup ${params.id} updated"
    7171                redirect(action:show,id:taskGroupInstance.id)
     
    7777        else {
    7878            flash.message = "TaskGroup not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskGroupInstance = new TaskGroup(params)
    91         if(!taskGroupInstance.hasErrors() && taskGroupInstance.save()) {
     91        if(!taskGroupInstance.hasErrors() && taskGroupInstance.save(flush: true)) {
    9292            flash.message = "TaskGroup ${taskGroupInstance.id} created"
    9393            redirect(action:show,id:taskGroupInstance.id)
  • trunk/grails-app/controllers/TaskModificationController.groovy

    r116 r178  
    2727        if(taskModificationInstance) {
    2828            try {
    29                 taskModificationInstance.delete()
     29                taskModificationInstance.delete(flush:true)
    3030                flash.message = "TaskModification ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskModificationInstance.properties = params
    69             if(!taskModificationInstance.hasErrors() && taskModificationInstance.save()) {
     69            if(!taskModificationInstance.hasErrors() && taskModificationInstance.save(flush: true)) {
    7070                flash.message = "TaskModification ${params.id} updated"
    7171                redirect(action:show,id:taskModificationInstance.id)
     
    7777        else {
    7878            flash.message = "TaskModification not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskModificationInstance = new TaskModification(params)
    91         if(!taskModificationInstance.hasErrors() && taskModificationInstance.save()) {
     91        if(!taskModificationInstance.hasErrors() && taskModificationInstance.save(flush: true)) {
    9292            flash.message = "TaskModification ${taskModificationInstance.id} created"
    9393            redirect(action:show,id:taskModificationInstance.id)
  • trunk/grails-app/controllers/TaskModificationTypeController.groovy

    r122 r178  
    2727        if(taskModificationTypeInstance) {
    2828            try {
    29                 taskModificationTypeInstance.delete()
     29                taskModificationTypeInstance.delete(flush:true)
    3030                flash.message = "TaskModificationType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskModificationTypeInstance.properties = params
    69             if(!taskModificationTypeInstance.hasErrors() && taskModificationTypeInstance.save()) {
     69            if(!taskModificationTypeInstance.hasErrors() && taskModificationTypeInstance.save(flush: true)) {
    7070                flash.message = "TaskModificationType ${params.id} updated"
    7171                redirect(action:show,id:taskModificationTypeInstance.id)
     
    7777        else {
    7878            flash.message = "TaskModificationType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskModificationTypeInstance = new TaskModificationType(params)
    91         if(!taskModificationTypeInstance.hasErrors() && taskModificationTypeInstance.save()) {
     91        if(!taskModificationTypeInstance.hasErrors() && taskModificationTypeInstance.save(flush: true)) {
    9292            flash.message = "TaskModificationType ${taskModificationTypeInstance.id} created"
    9393            redirect(action:show,id:taskModificationTypeInstance.id)
  • trunk/grails-app/controllers/TaskPriorityController.groovy

    r122 r178  
    2727        if(taskPriorityInstance) {
    2828            try {
    29                 taskPriorityInstance.delete()
     29                taskPriorityInstance.delete(flush:true)
    3030                flash.message = "TaskPriority ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskPriorityInstance.properties = params
    69             if(!taskPriorityInstance.hasErrors() && taskPriorityInstance.save()) {
     69            if(!taskPriorityInstance.hasErrors() && taskPriorityInstance.save(flush: true)) {
    7070                flash.message = "TaskPriority ${params.id} updated"
    7171                redirect(action:show,id:taskPriorityInstance.id)
     
    7777        else {
    7878            flash.message = "TaskPriority not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskPriorityInstance = new TaskPriority(params)
    91         if(!taskPriorityInstance.hasErrors() && taskPriorityInstance.save()) {
     91        if(!taskPriorityInstance.hasErrors() && taskPriorityInstance.save(flush: true)) {
    9292            flash.message = "TaskPriority ${taskPriorityInstance.id} created"
    9393            redirect(action:show,id:taskPriorityInstance.id)
  • trunk/grails-app/controllers/TaskProcedureController.groovy

    r131 r178  
    2727        if(taskProcedureInstance) {
    2828            try {
    29                 taskProcedureInstance.delete()
     29                taskProcedureInstance.delete(flush:true)
    3030                flash.message = "TaskProcedure ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskProcedureInstance.properties = params
    69             if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save()) {
     69            if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) {
    7070                flash.message = "TaskProcedure ${params.id} updated"
    7171                redirect(action:show,id:taskProcedureInstance.id)
     
    7777        else {
    7878            flash.message = "TaskProcedure not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskProcedureInstance = new TaskProcedure(params)
    91         if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save()) {
     91        if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) {
    9292            flash.message = "TaskProcedure ${taskProcedureInstance.id} created"
    9393            redirect(action:show,id:taskProcedureInstance.id)
  • trunk/grails-app/controllers/TaskProcedureDetailedController.groovy

    r155 r178  
    9191            }
    9292            taskProcedureInstance.properties = params
    93             if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save()) {
     93            if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) {
    9494                flash.message = "TaskProcedure ${params.id} updated"
    9595                redirect(action:show,id:taskProcedureInstance.id)
     
    123123        def taskInstance = Task.get(params.taskInstance.id)
    124124
    125         if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save()) {
     125        if(!taskProcedureInstance.hasErrors() && taskProcedureInstance.save(flush: true)) {
    126126            taskProcedureInstance.addToTasks(taskInstance)
    127127            flash.message = "TaskProcedure ${taskProcedureInstance.id} created."
  • trunk/grails-app/controllers/TaskRecurringScheduleController.groovy

    r159 r178  
    6767            }
    6868            taskRecurringScheduleInstance.properties = params
    69             if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save()) {
     69            if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save(flush: true)) {
    7070                flash.message = "TaskRecurringSchedule ${params.id} updated"
    7171                redirect(action:show,id:taskRecurringScheduleInstance.id)
     
    8989    def save = {
    9090        def taskRecurringScheduleInstance = new TaskRecurringSchedule(params)
    91         if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save()) {
     91        if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save(flush: true)) {
    9292            flash.message = "TaskRecurringSchedule ${taskRecurringScheduleInstance.id} created"
    9393            redirect(action:show,id:taskRecurringScheduleInstance.id)
  • trunk/grails-app/controllers/TaskRecurringScheduleDetailedController.groovy

    r157 r178  
    9393                taskRecurringScheduleInstance.setNextTargetCompletionDate()
    9494
    95                 if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save())
     95                if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save(flush: true))
    9696                {
    9797                    flash.message = "Recurring Schedule ${params.id} updated"
     
    139139            }
    140140
    141             if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save()) {
     141            if(!taskRecurringScheduleInstance.hasErrors() && taskRecurringScheduleInstance.save(flush: true)) {
    142142
    143143                taskInstance.taskRecurringSchedule = taskRecurringScheduleInstance
    144144
    145                 if(taskInstance.save()) {
     145                if(taskInstance.save(flush: true)) {
    146146                    flash.message = "Recurring Schedule ${taskRecurringScheduleInstance.id} created"
    147147                    redirect(action:show,id:taskRecurringScheduleInstance.id)
  • trunk/grails-app/controllers/TaskStatusController.groovy

    r122 r178  
    2727        if(taskStatusInstance) {
    2828            try {
    29                 taskStatusInstance.delete()
     29                taskStatusInstance.delete(flush:true)
    3030                flash.message = "TaskStatus ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskStatusInstance.properties = params
    69             if(!taskStatusInstance.hasErrors() && taskStatusInstance.save()) {
     69            if(!taskStatusInstance.hasErrors() && taskStatusInstance.save(flush: true)) {
    7070                flash.message = "TaskStatus ${params.id} updated"
    7171                redirect(action:show,id:taskStatusInstance.id)
     
    7777        else {
    7878            flash.message = "TaskStatus not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskStatusInstance = new TaskStatus(params)
    91         if(!taskStatusInstance.hasErrors() && taskStatusInstance.save()) {
     91        if(!taskStatusInstance.hasErrors() && taskStatusInstance.save(flush: true)) {
    9292            flash.message = "TaskStatus ${taskStatusInstance.id} created"
    9393            redirect(action:show,id:taskStatusInstance.id)
  • trunk/grails-app/controllers/TaskTypeController.groovy

    r122 r178  
    2727        if(taskTypeInstance) {
    2828            try {
    29                 taskTypeInstance.delete()
     29                taskTypeInstance.delete(flush:true)
    3030                flash.message = "TaskType ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            taskTypeInstance.properties = params
    69             if(!taskTypeInstance.hasErrors() && taskTypeInstance.save()) {
     69            if(!taskTypeInstance.hasErrors() && taskTypeInstance.save(flush: true)) {
    7070                flash.message = "TaskType ${params.id} updated"
    7171                redirect(action:show,id:taskTypeInstance.id)
     
    7777        else {
    7878            flash.message = "TaskType not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def taskTypeInstance = new TaskType(params)
    91         if(!taskTypeInstance.hasErrors() && taskTypeInstance.save()) {
     91        if(!taskTypeInstance.hasErrors() && taskTypeInstance.save(flush: true)) {
    9292            flash.message = "TaskType ${taskTypeInstance.id} created"
    9393            redirect(action:show,id:taskTypeInstance.id)
  • trunk/grails-app/controllers/UnitOfMeasureController.groovy

    r116 r178  
    2727        if(unitOfMeasureInstance) {
    2828            try {
    29                 unitOfMeasureInstance.delete()
     29                unitOfMeasureInstance.delete(flush:true)
    3030                flash.message = "UnitOfMeasure ${params.id} deleted"
    3131                redirect(action:list)
     
    6767            }
    6868            unitOfMeasureInstance.properties = params
    69             if(!unitOfMeasureInstance.hasErrors() && unitOfMeasureInstance.save()) {
     69            if(!unitOfMeasureInstance.hasErrors() && unitOfMeasureInstance.save(flush: true)) {
    7070                flash.message = "UnitOfMeasure ${params.id} updated"
    7171                redirect(action:show,id:unitOfMeasureInstance.id)
     
    7777        else {
    7878            flash.message = "UnitOfMeasure not found with id ${params.id}"
    79             redirect(action:edit,id:params.id)
     79            redirect(action:list)
    8080        }
    8181    }
     
    8989    def save = {
    9090        def unitOfMeasureInstance = new UnitOfMeasure(params)
    91         if(!unitOfMeasureInstance.hasErrors() && unitOfMeasureInstance.save()) {
     91        if(!unitOfMeasureInstance.hasErrors() && unitOfMeasureInstance.save(flush: true)) {
    9292            flash.message = "UnitOfMeasure ${unitOfMeasureInstance.id} created"
    9393            redirect(action:show,id:unitOfMeasureInstance.id)
Note: See TracChangeset for help on using the changeset viewer.