Hi, I have a requirement to detect whether the failure of writing to DB was due to lost connection (in which case I need to write that record to file x.csv) or due to the corrupted data (for example one column of the table was too long) (in which case I need to write the record to another file y.csv). I have tried to use: hibernate.c3p0.testConnectionOnCheckin=true hibernate.c3p0.testConnectionOnCheckout=true I was thinking that with those flags specified I might get some specific exception when I try to begin transaction (while the connection to DB is lost). However, whether I use those flags or not the exception that is being thrown is the same (org.hibernate.exception.GenericJDBCException: Cannot open connection) – so I don’t have a mechanism to figure out whether the exception is because of lost connection or anything else. Is there a method to do what I need – can somebody point me into right direction, please? Regards, Janusz
|