Core Container Improvements Data Access Improvements Caching Improvements

4.3.9.RELEASE Spring Framework 33

6. New Features and Enhancements in Spring Framework 4.3

Version 4.3 included a number of improvements, as described in the following sections: • Section 6.1, “Core Container Improvements” • Section 6.2, “Data Access Improvements” • Section 6.3, “Caching Improvements” • Section 6.4, “JMS Improvements” • Section 6.5, “Web Improvements” • Section 6.6, “WebSocket Messaging Improvements” • Section 6.7, “Testing Improvements” • Section 6.8, “Support for new library and server generations”

6.1 Core Container Improvements

• Core container exceptions provide richer metadata to evaluate programmatically. • Java 8 default methods get detected as bean property getterssetters. • Lazy candidate beans are not being created in case of injecting a primary bean. • It is no longer necessary to specify the Autowired annotation if the target bean only defines one constructor. • Configuration classes support constructor injection. • Any SpEL expression used to specify the condition of an EventListener can now refer to beans e.g. beanName.method . • Composed annotations can now override array attributes in meta-annotations with a single element of the component type of the array. For example, the String[] path attribute of RequestMapping can be overridden with String path in a composed annotation. • PersistenceContext PersistenceUnit selects a primary EntityManagerFactory bean if declared as such. • Scheduled and Schedules may now be used as meta-annotations to create custom composed annotations with attribute overrides. • Scheduled is properly supported on beans of any scope.

6.2 Data Access Improvements

• jdbc:initialize-database and jdbc:embedded-database support a configurable separator to be applied to each script. 4.3.9.RELEASE Spring Framework 34

6.3 Caching Improvements

Spring 4.3 allows concurrent calls on a given key to be synchronized so that the value is only computed once. This is an opt-in feature that should be enabled via the new sync attribute on Cacheable . This features introduces a breaking change in the Cache interface as a getObject key, CallableT valueLoader method has been added. Spring 4.3 also improves the caching abstraction as follows: • SpEL expressions in caches-related annotations can now refer to beans i.e. beanName.method . • ConcurrentMapCacheManager and ConcurrentMapCache now support the serialization of cache entries via a new storeByValue attribute. • Cacheable , CacheEvict , CachePut , and Caching may now be used as meta-annotations to create custom composed annotations with attribute overrides.

6.4 JMS Improvements