What's New With 7.2.0
November 18, 2023
Last updated
Was this helpful?
November 18, 2023
Last updated
Was this helpful?
Welcome to ColdBox 7.2.0, which packs a big punch on stability and tons of new features.
A new helper has been born that assists you with dealing with Database Schema-related methods that are very common and core to ColdBox and supporting modules. This will grow as needed and be decoupled to its own module later.
hasTable()
hasColumn()
getDatabaseInfo()
getTextColumnType()
getDateTimeColumnType()
getQueryParamDateTimeType()
allApply()
error handlersThe allApply()
is great when dealing with async operations on arrays or collections of objects. However, if something blows up, it would blow up with no way for you to log in or know what happened. However, now you can pass an errorHandler
argument which is a UDF/closure that will be attached to the onException()
method of the future object. This way, you can react, log, or recover.
All scheduled tasks now have a group
property so you can group your tasks. This is now available when creating tasks or setting them manually.
You can then get the group using the getGroup()
method or it will be added to all task metadata and stats.
everySecond()
periodA new period method shortcut: everySecond()
. Very useful so you can fill up your logs with data.
All task results, if any, are now stored in a ColdBox Optional. Which is a class that can deal with nulls gracefully and it's very fluent:
New method to get the last result, if any, from a task via the getLastResult()
method.
Lot's of great new methods and goodies so you can deal with date and times and timezones Oh My!
now( [timezone] )
getSystemTimezoneAsString()
getLastBusinessDayOfTheMonth()
getFirstBusinessDayOfTheMonth()
dateTimeAdd()
timeUnitToSeconds()
validateTime()
getIsoTime()
toInstant()
toLocalDateTime()
parse()
toLocalDate()
getTimezone()
getSystemTimezone()
toJavaDate()
duration()
period()
If in your binder you declare aspects or AOP bindings. Then WireBox will automatically detect it and load the AOP Mixer listener for you. You no longer have to declare it manually.
When you declare categories in LogBox you usually choose the appenders to send messages to, but you could never exclude certain ones. Now you can use the exclude
property:
You now have two new event listeners that all LogBox appenders can listen to:
preProcessQueue( queue, context )
: Fires before a log queue is processed element by element.
postProcessQueue( queue, context )
: After the log queue has been processed and after the listener has slept.
processQueueElement
receives the queueThe processQueueElement( data, context, queue )
now receives the entire queue as well as the queue
third argument.
If you use the RollingFileAppender
the default layout format of the archive package was static and you could not change it. The default is:
Now you have the power. You can set a property for the appender called archiveLayout
which maps to a closure/UDF that will build out the layout of the file name.
The full release notes per library can be found below. Just click on the library tab and explore their release notes:
You can now configure CacheBox by just passing a struct of config data:
You can now configure LogBox by just passing a struct of config data:
Scheduled tasks now get a `group` property so you can use it for grouping purposes
New `now()` method in the DateTmeHelper with optional TimeZone
New datetimehelper method: getSystemTimezoneAsString()
New ScheduledTask helper: getLastResult() to get the latest result
LastResult is now a cbproxies Optional to denote a value or not (COMPAT)
new scheduledTask method: isEnabled() to verify if the task is enabled
Complete rewrite of Scheduled Task setNextRuntime() calculations to account for start end running scenarios
new ScheduledTask period : everySecond()
New SchemaInfo helper to help interrogate databases for metadata
Add an errorHandler to the allApply method so you can attach your own error handler to each future computation
casting to long instead of int when using LocalDateTime and plus methods to avoid casting issues.
Do not expose restful handler exception data unless you are in debug mode
RestHandler.cfc should catch NotAuthorized exception
getFirstBusinessDayOfTheMonth(), getLastBusinessDayOfTheMonth() now refactored to the dateTimeHelper
validateTime() is now a helper method in the DateTimeHelper
Migration of old tasks to new task syntax of task()
Scheduled Task Stats "NextRun", "Created", "LastRun" Using Wrong Timezones
onSessionEnd Error when using Coldbox_App_Key
Scheduled task isConstrainted() on day of the month was calculating the days in month backwards
set next run time when using first or last business day was not accounting times
Make wirebox.system.aop.Mixer
listener load automatically if any aspects are defined/mapped
Support ad-hoc struct literal of CacheBox DSL to configure CacheBox
New listeners for all appenders: preProcessQueue() postProcessQueue()
Add the queue as an argument to the processQueueElement() method
new rolling appender property archiveLayout
which is a closure that returns the pattern of the archive layout
Unhandled race conditions in FileRotator lead to errors and potential log data loss
log rotator was not checking for file existence and 1000s of errors could be produced
Support ad-hoc struct literal of LogBox DSL to configure LogBox
Add `Exclude` key to Logbox Categories to Easily Exclude Appenders
shutdown the appenders first instead of the executors to avoid chicken and egg issues
Change fileMaxArchives default from 2 to 10
Removal of instance approach in preferences to accessors for the LogBoxConfig