Jagdish Gahlot wrote:hi Christian.. thanks for your help, your example is completely working but i have one situation where i don't want to declare 2 persistence entity factory bean (LocalContainerEntityManagerFactoryBean) rather than i want to use single persistence factory dealing with multiple PUs which in turn will use multiple Datasources. i tried lots of option but couldn't get.
Is there a way that we can declare one single bean of LocalContainerEntityManagerFactoryBean which will be defining 1 PersistenceUnitManager and that PersistenceUnitManager will define a list of datasources. then how my DAO will use these Datasources (either of them at a time) ? also in persistence.xml file i will define 2 persistence unit name bt how there PU name will be linked with datasources defined in my applicationContext.xml 's datasources. i hope everyone is getting what i mean to say exactly.
Vyas Sanzgiri wrote:I just see one datasource in the configuration file you posted. Can you please post the complete file with 2 data sources and the exception ? It looks as if you are naming both beans entityManagerFactory. Try changing the name