Re: [5.4] hibernate events

2013-12-18 Thread Lance Java
Great! Note, you could reduce the verbosity by getting rid of the interface, NOT registering a service and using @Autobuild Ie: @Startup public static void initHibernateEventListener(@Autobuild HibernateInitializerImpl hi) { hi.initialize(); }

Re: [5.4] hibernate events

2013-12-17 Thread Matthias
Thanks Lance, got it working. public interface HibernateInitializer { public void initialize(); } public class HibernateInitializerImpl implements HibernateInitializer { @Inject SolrIndexer solrIndexer; @Inject private HibernateSessionSource hss; @Override public v

Re: [5.4] hibernate events

2013-12-17 Thread Lance Java
I'm not convinced you should be doing this in a HibernateConfigurer since you need the SessionSource. HibernateConfigurers are executed before the SessionFactory exists. Can you add the listener in a @Startup method or some @EagerLoad service?

Re: [5.4] hibernate events

2013-12-16 Thread Matthias
Thanks Thiago, sometimes its to easy :). Now I've got everything injected, but my EventListenerHibernateConfigurer still don't work: java.lang.RuntimeException: Exception constructing service 'ValueEncoderSource': Error invoking service contribution method org.apache.tapestry5.hibernate.modu

Re: [5.4] hibernate events

2013-12-16 Thread Thiago H de Paula Figueiredo
On Sun, 15 Dec 2013 12:08:53 -0200, Matthias wrote: in AppModule public static void contributeHibernateSessionSource(OrderedConfiguration config) { config.add("EventListener", new EventListenerHibernateConfigurer()); } If you use the 'new' keyword directly, no inje

[5.4] hibernate events

2013-12-15 Thread Matthias
Hi, today I tried to add some hibernate event listeners to my application. This was my first naive approach: in AppModule public static void contributeHibernateSessionSource(OrderedConfiguration config) { config.add("EventListener", new EventListenerHibernateConfigurer()); }