Results 1 to 3 of 3

Thread: Injecting PersistenceContext into QuartzJobBean?

  1. #1
    Join Date
    Nov 2007
    Posts
    22

    Default Injecting PersistenceContext into QuartzJobBean?

    I'm needing to do some JPA stuff in a QuartzJobBean and I want to make use of the already set up EntityManager in my Spring configuration. I was hoping that using the SpringBeanJobFactory for the jobFactory in my SchedulerFactoryBean would do it, but it's still not getting injected. How should I go about getting the EntityManager injected?

  2. #2
    Join Date
    Nov 2007
    Posts
    22

    Default

    I ended up trying MethodInvokingJobDetailFactoryBean instead of the regular JobDetailBean and that made the EntityManager get injected, but it doesn't seem to do anything with the @Transactional annotation which I need. I have
    Code:
    <tx:annotation-driven transaction-manager="transactionManager" />
    set up which seems to handle it everywhere else, but this.

  3. #3
    Join Date
    Nov 2007
    Posts
    22

    Default

    Nevermind...somehow solved it...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •