Closed sqllyw closed 3 years ago
if con.disconnect(), it works, but the code is used in a web app, and con.disconnect after every update does not seems a good approach
con.startNewTransaction( (err, tx) => {
const result = tx.prepareSync(sql );
result.execSync()
tx.commitSync()
con.disconnect() // adding this works
})
See execInTransSync/execInTrans
execInTransSync works, thanks
Hi,
I have some code as following, if I use the connection object's prepareSync, it works, but if I startNewTransaction, the update did not happen in the database, any idea? Thanks.