Trung Huynh
Trung Huynh

Reputation: 303

Can't inject or get persistenceInterceptor

I'm doing for my own Quartz and don't use Quartz plugin (because sometimes Quartz plugin is not stable). I declared all of it in applicationContext.xml. When I do it, it throws exception involve to Hibernate session, then I found I need bind current Hibernate session and my Quartz session into one. And I need use persistenceInterceptor to do it.

I met problem here, persistentInterceptor can't inject and I received null object when do with it. I think it created by Grails and just can inject into service and controller.

So have any way to inject sessionFactory or persistenceInterceptor or anything which Grails created to it?

Thanks in advance!

Upvotes: 0

Views: 211

Answers (1)

Trung Huynh
Trung Huynh

Reputation: 303

OK, I solved it by myself.

By declare job in resource.groovy and inject persistenceInterceptor in it. It worked fine!

Upvotes: 0

Related Questions