Offhand, does anyone know if cftransaction can wra...
# cfml-general
r
Offhand, does anyone know if cftransaction can wrap a cfstoredproc? I am not as familiar as I should be with sprocs in general
t
To my knowledge it can, but it’s been a while since I’ve worked around it. We have some older code wrapped in transactions that calls a mix of cfquery and storedproc and every piece of that process will commit/rollback depending on exceptions etc.
👍 2
r
Thanks Tony, I appreciate it
Gives me a place to start. My google-fu did not find any relevant results
d
@Robert Zehnder Yes, cftransaction can be wrapped around any code. It's going to start a transaction at the JDBC level and then any other JDBC commands triggered within the block will be part of the transaction. Because of this, just make sure you don't have any slow running processes or you're blocking access to your tables. For example, if you were doing HTTP calls to a REST API inside a transaction block, that's bad. So do any heavy lifting outside of the transaction block.
s
Unless a later version of CF broke something, yes, cfstoredproc can be run within a cftransaction block. That said, I never found the need to use cfstoredproc; cfquery has always worked for me.