Maybe along the same lines, but slightly different:
I have a table full of calculated values, of which a bunch ( 1000+ ) need to be updated every day, (with no table dependencies).
First, I prep. a nested struct of all the new property values, for all the records that I want to change ( no issue there, a couple of fast fetching findAll's, and some math ). But, my current plan loops over this 1000+ element struct, updates them one at a time ( a brutal n+1 update query loop on it... )
model("ModelName").updateOne(where="id=#theIdToUpdate#",properties=propertiesToUpdateStruct,callbacks=false,reload=true)>
I would use updateAll() ... however each row has different data to be updated by PK, so not a mass-update like DeleteAll(where="color='red'"). Really want to avoid cfquery.
I mostly doesn't work in production reliably, even with the server at idle, it inevitably gets stuck.
java.net.SocketInputStream.socketRead0(null:???)[Native Method]
java.net.SocketInputStream.read(null:???)
java.net.SocketInputStream.read(null:???)
com.microsoft.sqlserver.jdbc.TDSChannel.read(IOBuffer.java:1782)
com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:4881)
- locked <0xe45b9da> (a com.microsoft.sqlserver.jdbc.TDSReader)
com.microsoft.sqlserver.jdbc.TDSCommand.detach(IOBuffer.java:5762)
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1704)
- locked <0x3ac9e88> (a java.lang.Object)
com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(SQLServerConnection.java:1761)
com.microsoft.sqlserver.jdbc.SQLServerConnection.rollback(SQLServerConnection.java:1964)
com.intergral.fusionreactor.jdbc.ConnectionSurrogate.rollback(ConnectionSurrogate.java:349)
railo.runtime.db.driver.ConnectionProxy.rollback(ConnectionProxy.java:228)
railo.runtime.db.DatasourceManagerImpl.rollback(DatasourceManagerImpl.java:153)
railo.runtime.tag.Transaction.doCatch(Transaction.java:120)
wheels.model.transactions_cfm$cf.udfCall(\wwwroot\wheels\model\transactions.cfm:64)