Thursday 9 June 2016

Spring @Transactional does not role back when exception occurs

I think you are dealing with custom exception like

public class CustomException extends Exception {

//Your code
}

But Spring @Transactional only deal with runtime exceptions. So you need to chnage in your code like 

public class CustomException extends RuntimeException {

//Your code
}



Thursday 21 January 2016

Unable to resolve owner of loading collection [[com.entity.ParentEntity.ChildEntity#61]] for second level caching

Example : org.hibernate.HibernateException: Unable to resolve owner of loading collection [[com.entity.ParentEntity.childEntity#56]] for second level caching

Please make sure you are enabled second level cache.
or otherwise comment this line

<!-- <cache usage="read-write" /> -->

Its working for me.