File tree Expand file tree Collapse file tree 4 files changed +48
-1
lines changed
klass-api/src/main/java/no/ssb/klass/api/config Expand file tree Collapse file tree 4 files changed +48
-1
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1010 <option name =" PACKAGE_NAME" value =" no.ssb.klass.api" />
1111 <option name =" MAIN_CLASS_NAME" value =" " />
1212 <option name =" METHOD_NAME" value =" " />
13- <option name =" TEST_OBJECT" value =" package" />
13+ <option name =" TEST_OBJECT" value =" tags" />
14+ <tag value =" !data-integrity" />
1415 <method v =" 2" >
1516 <option name =" Make" enabled =" true" />
1617 </method >
Original file line number Diff line number Diff line change 1+ <component name =" ProjectRunConfigurationManager" >
2+ <configuration default =" false" name =" Klass shared tests" type =" JUnit" factoryName =" JUnit" >
3+ <module name =" klass-shared" />
4+ <extension name =" coverage" >
5+ <pattern >
6+ <option name =" PATTERN" value =" no.ssb.klass.api.applicationtest.*" />
7+ <option name =" ENABLED" value =" true" />
8+ </pattern >
9+ </extension >
10+ <option name =" PACKAGE_NAME" value =" no.ssb.klass" />
11+ <option name =" MAIN_CLASS_NAME" value =" " />
12+ <option name =" METHOD_NAME" value =" " />
13+ <option name =" TEST_OBJECT" value =" package" />
14+ <method v =" 2" >
15+ <option name =" Make" enabled =" true" />
16+ </method >
17+ </configuration >
18+ </component >
Original file line number Diff line number Diff line change 1+ package no .ssb .klass .api .config ;
2+
3+ import org .springframework .boot .autoconfigure .AutoConfiguration ;
4+ import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
5+ import org .springframework .boot .autoconfigure .orm .jpa .HibernateJpaAutoConfiguration ;
6+ import org .springframework .context .annotation .Bean ;
7+ import org .springframework .context .annotation .Primary ;
8+ import org .springframework .jdbc .datasource .LazyConnectionDataSourceProxy ;
9+
10+ import javax .sql .DataSource ;
11+
12+ /**
13+ * Configuration class that sets up a lazy-loading data source proxy to improve performance by
14+ * deferring physical database connections until they are actually needed. This optimization is
15+ * particularly useful in scenarios where database operations don't always occur during request
16+ * processing.
17+ */
18+ @ AutoConfiguration (
19+ after = {DataSourceAutoConfiguration .class },
20+ before = {HibernateJpaAutoConfiguration .class })
21+ class LazyConnectionDataSourceProxyConfig {
22+
23+ @ Bean
24+ @ Primary
25+ DataSource lazyConnectionDataSourceProxy (DataSource dataSource ) {
26+ return new LazyConnectionDataSourceProxy (dataSource );
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments