0

I have configured 2 different data souces in my Teiid Spring Boot Application and have been following this example:

https://github.com/teiid/teiid-spring-boot/blob/master/docs/UserGuide.adoc

This example demonstrates a union query from Customer table from two different data sources, however, when i run my application the customerrepository retrieves records only from one database and not from the other.

I have uploaded my source code on github:

https://github.com/purnimadas27/TeiidExample1/tree/master/TeiidSpringBootPrj5

Can someone suggest why is my union query not retrieving results as expected, it appears that the customerrepository is bound to only one of the datasource and is retrieving results only from one datasource and it also appears that @SelectQuery is not being considered at all.

Any help is greatly appreciated, thank you!

1 Answers1

0

See this full example here with updated document

Updated: I could not figure out root issue is, this was not occurring with latest code, so wrote a new example with 1.3.1 release of the Teiid Spring Boot. This should work.

Ramesh Reddy
  • 554
  • 1
  • 3
  • 8
  • Hello, i created a new application and followed exactly your updated example, this is what i get: Error starting ApplicationContext. Description: Field customerRepository in org.teiid.spring.example.Application required a bean named 'entityManagerFactory' that could not be found. I have used Spring Boot 2.1.6.RELEASE and Teiid 1.3.0, does it differs from yours? – Purnima Das Jan 31 '20 at 05:32
  • you are correct, I am seeing the same error when the project is outside Teiid repo. Spring Boot supposed to wire this automatically but it is not. I suspect there is a configuration of some kind missing, which is not readily evident for me. Will let you know what I find out. – Ramesh Reddy Jan 31 '20 at 19:11
  • see the "updated" section above, hopefully this works for you. – Ramesh Reddy Jan 31 '20 at 21:43
  • Hello, have you tried your updated section successfully?, i don't see this any different than my version, even the Spring and Teiid version matches and mine still doesn't works, did it work for you? thank you, purnima das – Purnima Das Feb 05 '20 at 09:47