Qoders Blog     About     Archive     Feed
by Qadeer Ahmad Khan

Automatic save of managed JPA entities outside of transaction

Repositories and transactions in Spring go hand in hand. All database access in Spring should be run inside a transaction, and you typically have @Transactional somewhere to enforce this. However, this is not always necessary. For example, when using Spring Data your repositories use SimpleJPARepository for CRUD functionality. The SimpleJPARepository... View entire post

Effective Java Summary

Here is a collection of short summaries of Joshua Blochs great book Effective Java for easy future reference. Effective Java - Creating and Destroying Objects Effective Java - Methods Common to All Objects Effective Java - Classes and Interfaces Effective Java - Generics Effective Java - Enums and Annotations Effective... View entire post

Effective Java - Serialization

Serialization (Ch 11) This is a short summary of Joshua Blochs book Effective Java chapter 11. I have only included items that I find relevant. Be careful when implementing Serializable (item 74) Costs of implementing Serializable: It decreases the flexibility to change a class’s implementation once it has been released,... View entire post

Effective Java - Concurrency

Concurrency (Ch 10) This is a short summary of Joshua Blochs book Effective Java chapter 10. I have only included items that I find relevant. Synchronize access to shared mutable data (Item 66) Reading or writing a variable other than long or double is atomic, so why use synchronized? Synchronized... View entire post