A Slight Difference Between Autowire byType and constructor

Spring documentation states that both autowire byType and constructor modes expect at most one bean definition in the ApplicationContext, so that it can be autowired into the depending bean. Here is the excerpt taken from Spring Reference Documentation Table 6.2. Autowiring modes; byType Allows a property to be autowired if exactly one bean of the […]

Read More →
A Transaction Gotcha When Using Spring with Hibernate

Spring’s transaction propagation rule SUPPORTS states that if there exists a transaction when the method is called, it should work within that transaction, otherwise it should work outside any transaction. Similarly, transaction propagation rule NOT_SUPPORTED states that if there exists any active transaction when the method is called, that active transaction should be suspended before […]

Read More →
What is the difference between Strategy and Template Method patterns…, if there is any?

In our Spring book, we discuss about transaction management mechanisms available in the Spring Framework, namely declarative and programmatic transactions. It is further explained inside programmatic transaction demarcation section, that how programmatic transaction can be achieved using different methods. One of the ways programmatic transaction can be achieved is, using TransactionTemplate utility class provided by […]

Read More →