Hello Christopher, 2013/2/17 Christopher Martin <[email protected]>: > I'm using Jooq within an Akka actor system. When an actor executes a query, > I want that actor to log the query using Akka's event system. I'd like to > accomplish this by configuring an appropriate logger each time I create a > Factory. > > As far as I can tell, it is impossible to get Jooq's ExecuteListener > framework to help me with this. Please correct me if I'm wrong on anything: > > - The only way to attach an ExecuteListener to a Factory is via Settings. > - A listener in Settings is configured only by *class name*. > - There is no way to obtain an ExecuteListener instance after Jooq has > instantiated it. > - Therefore there is no way to configure an ExecuteListener at runtime. > > It seems to me there ought to be an ability, either in Settings or in > Factory, to specify an ExecuteListener by providing the object itself (or > something like javax.inject.Provider<ExecuteListener>), because the current > system using reflection upon class names is a rather restrictive Rube > Goldberg configuration mechanism.
This will be adressed in jOOQ 3.0: https://github.com/jOOQ/jOOQ/issues/1578 ExecuteListener *instances* (not class names) can be provided to an Executor (what is called Factory in jOOQ 2.6). This will allow you to re-gain full control over ExecuteListener lifecycle. > As far as I can tell, it is impossible to get Jooq's ExecuteListener > framework to help me with this. Please correct me if I'm wrong on anything: You can still use static or ThreadLocal mechanisms to dispatch messages to the appropriate recipient. There are solutions / tricks, although they probably do not feel very elegant... Cheers Lukas -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
