Task #3052
closed
Multiple persistence contexts with separate connection pools
Added by Peter Štrunc almost 3 years ago.
Updated over 2 years ago.
Description
In order to have separate connection pool for database logging (and potentially other use-cases) we need to introduce another entity manager, which will operate on a separate datasource and will have its own configuration.
Some work has already been done on this in #3036.
- Status changed from New to In Progress
Implemetation is in progress in pstrunc/two-datasources
- Sprint set to Sprint 12.2-1 (Feb 18 - Mar 02)
- Sprint changed from Sprint 12.2-1 (Feb 18 - Mar 02) to Sprint 12.2-2 (Mar 02 - Mar 16)
- Status changed from In Progress to Needs feedback
- Assignee changed from Peter Štrunc to Roman Kučera
- % Done changed from 0 to 80
I moved implementation to pstrunc/3052-multiple-datasources.
Flyway, Audits and H2 database is working.
TODO:
Documentation
@kucerar would you please review the code and try the functionality with rpt module?
- Status changed from Needs feedback to In Progress
- Assignee changed from Roman Kučera to Peter Štrunc
Thx for this feature.
I like the solution. It works nicely.
I tested it with custom reports module, adding new datasource in module is working correctly to.
In PR there are only two small things
Now I am checking Github actions. If it pass and documentation will be finished we can merge it.
After that we can merge it to develop
Github actions failed
https://github.com/bcvsolutions/CzechIdMng/runs/6154422992?check_suite_focus=true
Error: Tests run: 9, Failures: 0, Errors: 1, Skipped: 8, Time elapsed: 0.035 s <<< FAILURE! - in eu.bcvsolutions.idm.rpt.report.identity.IdentityIncompatibleRoleReportExecutorIntegrationTest
Error: testConvertSwagger(eu.bcvsolutions.idm.rpt.Swagger2MarkupTest) Time elapsed: 0.017 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accTestHelper': Unsatisfied dependency expressed through field 'entityManager'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'javax.persistence.EntityManager' available: expected single matching bean but found 2: org.springframework.orm.jpa.SharedEntityManagerCreator#0,org.springframework.orm.jpa.SharedEntityManagerCreator#1
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'javax.persistence.EntityManager' available: expected single matching bean but found 2: org.springframework.orm.jpa.SharedEntityManagerCreator#0,org.springframework.orm.jpa.SharedEntityManagerCreator#1
@sourek can you check it please?
- Status changed from In Progress to Resolved
- % Done changed from 80 to 100
Peter fix it.
Merged into devel.
- Status changed from Resolved to Closed
Also available in: Atom
PDF