Query Async
Query Async
Execute queries asynchronously when you don't need to wait for the result.
Async Execution
query async=true {
~~~
update user set lastAccess=now()
~~~
}
But you may want to know when an exception is happening, so we use a local listener:
query datasource="mysql" async=true listener={
error: function (args, caller, meta, exception) {
systemOutput(exception, true, true);
}
} {
~~~
update user set lastAccess=now()
~~~
}
Other Option
Since Lucee 6.1, this can also be done with the help of "function listeners".