# Gin: preserve requirements through advanced agent edits - [Keep Gin reservation and order creation on database/sql’s transaction handle](https://frameworkrecipes.dev/gin/reservation-transaction/guide.md): Using sql.DB inside a transaction function can obtain a different pooled connection. An order written there may survive rollback of the stock update. Keep both writes on sql.Tx, check affected rows, defer rollback, and commit only after all steps succeed. - [reservation-tx-handle rule pack](https://reporules.fyi/gin/reservation-transaction/rule-pack.zip): YAML requirement and agent task. - [Keep Gin’s pooled context out of the background queue](https://frameworkrecipes.dev/gin/immutable-background-jobs/guide.md): Gin contexts are reused after a request. Copy immutable values into a job and let a worker own its own context. An accepted response must mean the queue actually accepted the work; otherwise the caller has no signal to retry a lost task. - [queue-acceptance-truthful rule pack](https://reporules.fyi/gin/immutable-background-jobs/rule-pack.zip): YAML requirement and agent task. - [Framework rule pack](https://reporules.fyi/gin/rule-pack.zip): All requirements from this framework site.