Ignore:
Timestamp:
08/20/13 15:32:37 (11 years ago)
Author:
George.Georgovassilis@mpi.nl
Message:

#360 Refactoring of transaction handling, tests and application context

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/test/resources/spring-config/datasource-hsqldb.xml

    r1944 r3449  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<beans xmlns="http://www.springframework.org/schema/beans"
    3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    4        xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:/org/springframework/beans/factory/xml/spring-beans-2.5.xsd">
    5     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    6         <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
    7         <property name="url" value="jdbc:hsqldb:mem:component_registry;sql.syntax_pgs=true"/>
    8         <property name="username" value="sa"/>
    9         <property name="password" value=""/>
    10     </bean>
     3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     4        xmlns:aop="http://www.springframework.org/schema/aop"
     5        xmlns:context="http://www.springframework.org/schema/context"
     6        xmlns:jdbc="http://www.springframework.org/schema/jdbc"
     7        xsi:schemaLocation="
     8     http://www.springframework.org/schema/beans
     9     http://www.springframework.org/schema/beans/spring-beans.xsd
     10     http://www.springframework.org/schema/aop
     11     http://www.springframework.org/schema/aop/spring-aop.xsd
     12     http://www.springframework.org/schema/context
     13     http://www.springframework.org/schema/context/spring-context.xsd
     14     http://www.springframework.org/schema/jdbc
     15     http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
     16     ">
    1117
    12     <bean id="jdbcTemplate"
    13         class="org.springframework.jdbc.core.JdbcTemplate">
    14         <property name="dataSource" ref="dataSource"/>
    15     </bean>
     18<!-- Without the transaction proxy, JdbcTemplate will close the active connection after each statement -->
     19        <bean id="dataSource"
     20                class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
     21                <property name="targetDataSource">
     22                        <bean class="org.apache.commons.dbcp.BasicDataSource">
     23                                <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
     24                                <property name="url"
     25                                        value="jdbc:hsqldb:mem:component_registry;sql.syntax_pgs=true" />
     26                                <property name="username" value="sa" />
     27                                <property name="password" value="" />
     28                                <property name="defaultAutoCommit" value="true"/>
     29                        </bean>
     30                </property>
     31        </bean>
     32
    1633</beans>
Note: See TracChangeset for help on using the changeset viewer.