Project

General

Profile

Revision afe10f33

IDafe10f331aabb92cf2bb92f29a86cace0492944a
Parent 528d4496
Child 2e1fd4da

Added by Andreas Kohlbecker 12 months 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)