To some extent you may be able to do it in configuration file by replacing the acc default behaviour with sqlops. The records are written by mysql when 200ok is received (which can be caught via an onreply_route) or a final negative response is handled (which can be caught via a failure_route). There you can use acc_db_request() to write the record to database and then sqlops to retrieve the ID. Just an idea by now, but it seems to be doable ...