2 Replies Latest reply on Jun 2, 2009 9:15 AM by Boleslaw Dawidowicz

    Setting user's roles doesn't trigger Hibernate PreInsert or

    John Gerevich Newbie

      I am using JBoss Portal 2.7.0 CR1 on Windows, JDK5

      I am logging JBoss Portal Admin usage via Hibernate Event listeners.

      I have added the listeners to server\default\deploy\jboss-portal.sar\conf\hibernate\user\hibernate.cfg.xml:

      <listener type="pre-update" class="mypackage.HibernateAuditLogListener"/>
       <listener type="pre-delete" class="mypackage.HibernateAuditLogListener"/>
       <listener type="pre-insert" class="mypackage.HibernateAuditLogListener"/>
       <listener type="pre-load" class="mypackage.HibernateAuditLogListener"/>

      I am able to catch User creation, modification, Role creation modification etc.

      But my PreUpdateListener or my PreInsertListener does NOT fire if I add a Role to a user's roles through the admin page:
      Members -> User management -> search users -> roles -> ...select roles.... -> submit

      Why doesn't my HibernateEventListener get fired when JBoss Portal saves the roles? How can I log setting the roles of a user?