How to get Exception from unique constraint

I use hibernate 5.2.10 & spring boot 2.1.1 & JTA & Weblogic
Now when we save any entity that has some constraint such as unique constraint & foreign key constraint … we get error but we could not get clear Exception in our back-end. Because our Exception catch in ResultSetReturnImpl and the result print with SqlExceptionHelper, so we could not catch those exception!!
My code is

public viod add (T entity){
Session session = getSession();
}catch (TransactionException ex){
   System.out.println("++++++++"); // Do Not go here when throw exception for unique constraint

So we could not find any answer for this problem!
Is there any answer??
Could we override ResultSetReturnImpl and customize this method?

I found answer!!!
It’s in spring configuration. I always use JTA for manage my transaction but should be use from JPA transaction for solve this issue.Like This

thank’s all