Announcement Announcement Module

JavaConfig forum decommissioned in favor of Core Container

As described at

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at
See more
See less
Injecting into @PersistenceContext fields Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Injecting into @PersistenceContext fields

    I had a hare-brained idea that I could use java config to inject EntityMangers that are autowired using the @PersistenceContext annotation. The EntityManagers are used in code that is demarcated with a @Transactional annotation. The goal being to swap-out EMs when testing so transactions may be rolled back. I've had a go to no avail. Anyone tried this or have any knowledge that might help???