The basic usecase is that I need to log that something has occurred, even if in my code an error occurred and the whole transaction is to be aborted.
For a variety of reasons it would be extremely convenient to not have to manually handle partial rollbacks via nested transactions. And my basic fallback is to log this information via a message queue and have that queue save records to the database.
My question is, is there a way to allow me to save a model even if I know the current transaction is being rolled back? Or is event publishing pretty much the only way?
Since I could not find any other ideas, the solution I went with is to throw these messages on a background processing queue and just rollback, and have background workers log this information.