Skip to content

Commit

Permalink
Remove unused sqlite datasource
Browse files Browse the repository at this point in the history
Change-Id: Ic1bcaa4095b9d46ab6480ad97f8c5429f7c670ea
  • Loading branch information
margaretha committed Jan 11, 2024
1 parent f4df2c0 commit 09a9a58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
27 changes: 1 addition & 26 deletions src/main/resources/default-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,6 @@
<property name="testConnectionOnCheckin" value="true" />
</bean>

<bean id="sqliteDataSource"
class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
lazy-init="true">
<property name="driverClassName"
value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="connectionProperties">
<props>
<prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
</props>
</property>

<!-- relevant for single connection datasource and sqlite -->
<property name="suppressClose">
<value>true</value>
</property>
<!--<property name="initialSize" value="2"/> -->
<!--<property name="poolPreparedStatements" value="true"/> -->
</bean>

<!-- to configure database for sqlite, mysql, etc. migrations -->
<bean id="flywayConfig"
class="org.flywaydb.core.api.configuration.ClassicConfiguration">
Expand All @@ -118,7 +96,6 @@
<property name="locations"
value="#{'${jdbc.schemaPath}'.split(',')}" />
<property name="dataSource" ref="dataSource" />
<!-- <property name="dataSource" ref="sqliteDataSource" /> -->
<!-- <property name="dataSource" ref="c3p0DataSource" /> -->
<property name="outOfOrder" value="true" />
</bean>
Expand All @@ -132,7 +109,6 @@
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
depends-on="flyway">
<property name="dataSource" ref="dataSource" />
<!-- <property name="dataSource" ref="sqliteDataSource" /> -->
<!-- <property name="dataSource" ref="c3p0DataSource" /> -->

<property name="packagesToScan">
Expand Down Expand Up @@ -314,8 +290,7 @@
<!-- similarly, don't forget the PlatformTransactionManager -->
<bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- <property name="dataSource" ref="dataSource" /> -->
<property name="dataSource" ref="sqliteDataSource" />
<property name="dataSource" ref="dataSource" />
<!-- <property name="dataSource" ref="c3p0DataSource" /> -->
</bean>

Expand Down
9 changes: 4 additions & 5 deletions src/test/resources/test-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@
<!--<property name="poolPreparedStatements" value="true"/> -->
</bean>

<!-- use SingleConnection only for testing! -->
<bean id="sqliteDataSource"
<!-- <bean id="sqliteDataSource"
class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
lazy-init="true">
<!-- <property name="driverClassName" value="${jdbc.driverClassName}" /> -->
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
Expand All @@ -80,12 +79,12 @@
</props>
</property>
<!-- Sqlite can only have a single connection -->
Sqlite can only have a single connection
<property name="suppressClose">
<value>true</value>
</property>
</bean>

-->
<bean id="c3p0DataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
Expand Down

0 comments on commit 09a9a58

Please sign in to comment.