Skip to content

Commit

Permalink
Added Tomcat JDBC pool.
Browse files Browse the repository at this point in the history
  • Loading branch information
hekonsek committed Mar 14, 2014
1 parent 764e603 commit 5e51f64
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<instructions>
<Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
<JPA-PersistenceUnits>PERSON</JPA-PersistenceUnits>
<!--<Dynamic-ImportPackage>*</Dynamic-ImportPackage>-->
</instructions>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.1.0"
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0">

<bean id="dataSource" class="org.hsqldb.jdbc.JDBCDataSource">
<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource"
destroy-method="close">
<property name="dataSource">
<bean class="org.hsqldb.jdbc.JDBCDataSource">
<property name="url" value="jdbc:hsqldb:mem:testDB"/>
<property name="user" value="sa"/>
<property name="password" value=""/>
</bean>
</property>
<property name="url" value="jdbc:hsqldb:mem:testDB"/>
<property name="user" value="sa"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
<property name="initialSize" value="5"/>
<property name="maxActive" value="10"/>
<property name="defaultAutoCommit" value="false"/>
</bean>

<service ref="dataSource" interface="javax.sql.DataSource">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
<artifactId>hsqldb</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>7.0.47</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public Option[] commonOptions() {
maven().groupId("org.apache.karaf.assemblies.features").artifactId("enterprise").type("xml")
.classifier("features").version("2.3.3"), "transaction", "jndi", "jpa"),

mavenBundle().groupId("org.apache.tomcat").artifactId("tomcat-jdbc").versionAsInProject(),
mavenBundle().groupId("org.hsqldb").artifactId("hsqldb").versionAsInProject(),

bundle("mvn:org.apache.commons/commons-lang3/3.1"),
Expand Down

0 comments on commit 5e51f64

Please sign in to comment.