Skip to content

Commit

Permalink
fix: Split HSQLDB connection files to avoid locks - MEED-3281 - #1589 (
Browse files Browse the repository at this point in the history
…#1592)

Prior to this change, when a connection leaks or hangs in one
datasource, it affects the access to other datasources while using
HSQLDB. This change will define one database file per Datasource to
avoid such a behavior.
  • Loading branch information
boubaker committed Jan 30, 2024
1 parent 85813b5 commit 091d058
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ validationQueryTimeoutOption=validationQueryTimeout="5"
driverClassName=org.hsqldb.jdbcDriver
username=sa
password=
url=jdbc:hsqldb:file:\${exo.data.dir}/hsql/exo-plf
urlIdm=jdbc:hsqldb:file:\${exo.data.dir}/hsql/idm
urlJpa=jdbc:hsqldb:file:\${exo.data.dir}/hsql/jpa
urlJcr=jdbc:hsqldb:file:\${exo.data.dir}/hsql/jcr
connectionParameters=;shutdown=true;hsqldb.write_delay=false;hsqldb.tx=mvcc;
jpaConnectionParameters=;shutdown=true;hsqldb.write_delay=false;hsqldb.tx=mvcc;
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ validationQueryTimeoutOption=validationQueryTimeout="5"
driverClassName=com.mysql.jdbc.Driver
username=plf
password=plf
url=jdbc:mysql://localhost:3306/plf
urlIdm=jdbc:mysql://localhost:3306/plf
urlJpa=jdbc:mysql://localhost:3306/plf
urlJcr=jdbc:mysql://localhost:3306/plf
connectionParameters=?autoReconnect=true
jpaConnectionParameters=?autoReconnect=true&characterEncoding=utf8
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ validationQueryTimeoutOption=validationQueryTimeout="5"
driverClassName=org.postgresql.Driver
username=plf
password=plf
url=jdbc:postgresql://localhost:5432/plf
urlIdm=jdbc:postgresql://localhost:5432/plf
urlJpa=jdbc:postgresql://localhost:5432/plf
urlJcr=jdbc:postgresql://localhost:5432/plf
connectionParameters=
jpaConnectionParameters=
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ validationQueryTimeoutOption=
driverClassName=com.edb.Driver
username=plf
password=plf
url=jdbc:edb://localhost:5432/plf
urlIdm=jdbc:edb://localhost:5432/plf
urlJpa=jdbc:edb://localhost:5432/plf
urlJcr=jdbc:edb://localhost:5432/plf
connectionParameters=
jpaConnectionParameters=
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
testWhileIdle="true" testOnBorrow="true" testOnReturn="false"
timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000"
removeAbandonedOnBorrow="true" removeAbandonedOnMaintenance="true" removeAbandonedTimeout="300" logAbandoned="false"
username="${username}" password="${password}" driverClassName="${driverClassName}" url="${url}${jpaConnectionParameters}" />
username="${username}" password="${password}" driverClassName="${driverClassName}" url="${urlIdm}${jpaConnectionParameters}" />

<!-- eXo JCR Datasource for portal -->
<Resource name="exo-jcr_portal" auth="Container" type="javax.sql.DataSource"
Expand All @@ -69,7 +69,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
testWhileIdle="true" testOnBorrow="true" testOnReturn="false"
timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000"
removeAbandonedOnBorrow="true" removeAbandonedOnMaintenance="true" removeAbandonedTimeout="300" logAbandoned="false"
username="${username}" password="${password}" driverClassName="${driverClassName}" url="${url}${connectionParameters}" />
username="${username}" password="${password}" driverClassName="${driverClassName}" url="${urlJcr}${connectionParameters}" />

<!-- eXo JPA Datasource for portal -->
<Resource name="exo-jpa_portal" auth="Container" type="javax.sql.DataSource"
Expand All @@ -79,7 +79,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
testWhileIdle="true" testOnBorrow="true" testOnReturn="false"
timeBetweenEvictionRunsMillis="30000" minEvictableIdleTimeMillis="60000"
removeAbandonedOnBorrow="true" removeAbandonedOnMaintenance="true" removeAbandonedTimeout="300" logAbandoned="false"
username="${username}" password="${password}" driverClassName="${driverClassName}" url="${url}${jpaConnectionParameters}" />
username="${username}" password="${password}" driverClassName="${driverClassName}" url="${urlJpa}${jpaConnectionParameters}" />

</GlobalNamingResources>

Expand Down

0 comments on commit 091d058

Please sign in to comment.