Non-database application transactions Non-database application transactions database database

Non-database application transactions


All these would have to be transactional resources, able to participate in a 2-phase commit protocol, in order to do what you want.

Unless you have a bug in your code, the update to the session should never fail. You could thus do it after the other updates are successful. The file system should just be avoided if you need something transactional. The alternative could be to start by saving to the file system, then do the database updates, and accept to have useless files in the file system if the DB update fails.