# Model.update gives neither result nor error

**URL:** <https://forums.swift.org/t/model-update-gives-neither-result-nor-error/86175>\
**Category:** Vapor\
**Created:** [April 22, 2026, 12:12pm UTC](https://forums.swift.org/t/model-update-gives-neither-result-nor-error/86175 "2026-04-22T12:12:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon68](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@simon68](https://forums.swift.org/u/simon68)\
**Post date:** [April 22, 2026, 12:12pm UTC](https://forums.swift.org/t/model-update-gives-neither-result-nor-error/86175/1 "2026-04-22T12:12:06Z")

</div>

In one of my route (update function) I am trying to:

1. look for a model in the database
2. if found, update one of its parent field
3. update the model on the database.

Here is the snippet:

```swift
    @Sendable
    func update(req: Request) async throws -> HTTPStatus {
        print("request update : \(req.body.string ?? "empty")")
        let photo = try req.content.decode(PhotoDTO.self)
        if let pic = try await Photo.find(photo.id, on: req.db) {
            print ("photo found size \(pic.pic.count)b")
            pic.$waste.id = photo.waste
            do {
                try await pic.update(on: req.db)
                print("pic saved")
            } catch {
                print("could not save \(pic.id!) \(error)")
            }
            return .ok
        } else {
            throw Abort(.badRequest, reason: "photo not found")
        }
    }

```

Every thing seem to work fine until `pic.update(on: req.db)` as one can see on the console log:

```swift
[INFO] POST /wastes/update [request-id: 8947C238-21E3-4AF3-8F1B-EE318E4CBB00]
request update : {"waste":"1D37656C-B12E-437B-A929-E7AF7CFBC86A","id":"EE56E014-1793-4113-9440-63CEDF50E8B6"}
photo found size 538528b

```

But then nothing happens. The model is not updated and there is no error thrown.

I suppose there must some stupid mistake somewhere but I am unable to find out where. Anyone has an idea what could cause this ?

---

<div class="post-metadata">

**Author:** ![simon68](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@simon68](https://forums.swift.org/u/simon68)\
**Post date:** [April 22, 2026, 12:34pm UTC](https://forums.swift.org/t/model-update-gives-neither-result-nor-error/86175/2 "2026-04-22T12:34:03Z")

</div>

OK I found the problem : the dabase was locked by `DB Browser for SQLite` ! I closed it and everything ran again !
