Hi,
what would be the best way to set a hibernate SessionFactoryInterceptor when using ejb3 entity beans rather than native hibernate services?
I'm using JBoss AS 4.0.4 GA Patch1 with hibernate3 and ejb3 persistence. For native hibernate services, JBoss reads the interceptor from hibernate-service.xml:
Code:
<mbean code="org.jboss.hibernate.jmx.Hibernate"
name="jboss.har:service=Hibernate">
<attribute name="DatasourceName">java:/DefaultDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.HSQLDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="SessionFactoryInterceptor">my.InterceptorImpl</attribute>
<attribute name="CacheProviderClass">
net.sf.hibernate.cache.HashtableCacheProvider
</attribute>
</mbean>
For ejb3 persistence, the persistence.xml file looks pretty similar, except there is no property for the SessionFactoryInterceptor that I would know of.
Code:
<persistence>
<persistence-unit name="manager1">
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
Fritz