Another Difference Between Autowire byType and constructor

Lets keep playing with autowiring behaviour of Spring Framework. Autowire byType or byName is not required by default. In other words, they will do nothing if they cannot find suitable candidates to inject into target beans. They can be made required in two different ways; One is to use @Required annotation in setter method if […]

Weird Autowiring Behaviour in Spring Framework

During lab sessions in our Enterprise Java trainings I usually leave the main track of lab outlines and start trying various cases related with the topic. It is a bit risky for me but it also becomes beneficial for attendees in terms of learning by experimenting with the framework. The risky point is that I […]

TransactionTemplate and Rollback Rules

When I was playing with TransactionTemplate during one of my Spring training sessions, I promptly suggested audience with trying to change default rollback rules while using TransactionTemplate. After all TransactionTemplate encapsulates boilerplate transaction begin, commit/rollback statements and we only give business logic part which it executes inside that begin…commit/rollback block. Because of this, I’ve thought […]

How to build SessionFactory in Hibernate 4

Well, I think it is the first time in Hibernate’s history that it is released with incomplete feature implementations and documentation. I came to this conclusion when I see Configuration.buildSessionFactory() method as deprecated. When I look at documentation however it still uses above method to create it! If you look at org.hibernate.cfg.Configuration class, it is […]