In this article I’ll discuss the use of the Spring Framework Transactions, to make the application more secure and without inconsistencies. But before you initiate a transaction in Spring, let’s first understand what are transactions. The transaction concept can be described with the acronym ACID. 1. Atomicity:- A transaction must be treated as a single …
Spring Annotations
@Inject and @Named Annotations Example
In this tutorial I am going to explain two of the spring annotations that are part of JSR-330. Support for JSR-330 annotations was introduced in Spring 3. These annotations are scanned the same way as the Spring annotations, only requirement would be to have the relevant jars in your classpath. You can use the following …
@Resource, @PostConstruct and @PreDestroy Annotations Example
In this post I shall cover the JSR250 annotations. Introduced in Spring 2.5, it added support for JSR-250 based annotations which include @Resource, @PostConstruct and @PreDestroy annotations. In my previous articles I have explained about the some of the popular annotations in Spring @Required, @Autowired and @Qualifier. Also please read about How to write Custom Spring Callback Methods? @Resource vs …
@Required Annotation in Spring
Since Spring 2.5, annotation-based configuration has been an alternative to XML setups. Annotation based configuration rely on the bytecode metadata for wiring up components instead of angle-bracket declarations (Also Read : Introduction to Spring Boot). Annotations can be used on the relevant class, method, or field declaration. In this tutorial I am going to explain …