-
Couldn't load subscription status.
- Fork 38.8k
Description
Sam Brannen opened SPR-12835 and commented
Status Quo
Since its inception, the <jdbc:embedded-database /> XML namespace element (or more specifically the EmbeddedDatabaseBeanDefinitionParser) has set the name of the embedded database that it creates to the value of the id attribute. This makes it impossible to reuse an XML configuration file containing such a bean definition in multiple application contexts loaded within the same JVM -- for example, by importing the common test data source configuration into multiple contexts loaded by the Spring TestContext Framework.
Furthermore, the EmbeddedDatabaseBuilder already provides support for setting the name in Java Config.
Deliverables
- Introduce a
database-nameattribute in<jdbc:embedded-database />to bring XML configuration of embedded databases on par with the support in Java Config.
Affects: 3.0 GA
Issue Links:
- Allow <jdbc:embedded-database /> to be declared as an anonymous bean [SPR-12834] #17431 Allow <jdbc:embedded-database /> to be declared as an anonymous bean ("depends on")
- Introduce support for generating unique names for embedded databases [SPR-8849] #13491 Introduce support for generating unique names for embedded databases ("is depended on by")
- jdbc:datasource lacks 'name' attribute or related mechanism [SPR-7604] #12260 jdbc:datasource lacks 'name' attribute or related mechanism
- Using multiple declarations of jdbc:embedded-database creates only one H2 instance per JVM [SPR-8920] #13560 Using multiple declarations of jdbc:embedded-database creates only one H2 instance per JVM ("supersedes")