Project

General

Profile

Revision 6d6ae033

ID6d6ae033423a188e1e97b16912b173088f16e688
Parent ff628107
Child 694f0ef2

Added by Andreas Kohlbecker about 1 year ago

ref #7106 logging unintentially creation of unmanaged new session in DaoBase with stacktrace

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DaoBase.java
55 55
    protected Session getSession(){
56 56
        Session session ;
57 57
        try {
58

  
59 58
            session = factory.getCurrentSession();
60 59
        } catch (HibernateException e) {
61
            logger.error("Opening new session in turn of a HibernateException", e);
60
            String stackTrace = "";
61
            for(StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace()) {
62
                stackTrace = stackTrace + System.lineSeparator() + stackTraceElement.toString();
63
            }
64
            logger.warn("[#7106] Opening new session in turn of a HibernateException: " + e.getMessage() + System.lineSeparator() + stackTrace);
62 65
            session = factory.openSession();
63 66
        }
64 67
        return session;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)