• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

creating one session factory from two or more applicationContext files having their own POJO list

 
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I have two applicationContext files coming from two different sources(jars)...and each of them have their applicationContext, and having declaration of sessionFactory.
But when i read both these applicationContexts i want to create a single instance of SessionFactory.

The problem is in automatic merging of lists of two files.

Here is the portion of applicationContext-A.xml



ApplicationContext-B.xml



What is required is



Can anyone explain how to accomplish this?

Thank you
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the instance of SessionFactory will be stored in a map, under the key "sessionFactory" so if you have more than one bean definition with the same id, but in different files, the last one read in wins. So this means that you can overwrite the other two definitions with yours, as long as you make sure yours is the last xml file read in.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic