ItEr15S04ArquitecturaServidorItEr14S04: Usage of SingleConnectionDataSource for testing the business layer.
Now the business layer uses org.springframework.jdbc.datasource.SingleConnectionDataSource as data source. Potentially, this data source is faster than the previous one (org.springframework.jdbc.datasource.DriverManagerDataSource). SingleConnectionDataSource only mantains one connection which is never closed. It cannot be used from more than one thread in parallel.
This commit is contained in:
parent
81117ed861
commit
f4a6016874
1 changed files with 8 additions and 3 deletions
|
|
@ -7,11 +7,16 @@
|
|||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
|
||||
|
||||
<!-- Data source -->
|
||||
<!-- Data source. SingleConnectionDataSource is a fast data source (it only
|
||||
mantains one connection which is never closed) for testing the
|
||||
bussiness layer. It cannot be used from more than one thread in
|
||||
parallel.
|
||||
-->
|
||||
<bean id="dataSource"
|
||||
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
|
||||
class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
|
||||
p:driverClassName="${jdbcDriver.className}" p:url="${testDataSource.url}"
|
||||
p:username="${testDataSource.user}" p:password="${testDataSource.password}" />
|
||||
p:username="${testDataSource.user}" p:password="${testDataSource.password}"
|
||||
p:suppressClose="true" />
|
||||
|
||||
|
||||
<!-- Hibernate Session Factory. -->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue