Skip to content

Commit f232397

Browse files
committed
sample: use c3p0 for connection pooling
1 parent dd1f3e9 commit f232397

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sample/pom.xml

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
<version>[2.2.220,2.999.9999]</version>
9696
<scope>runtime</scope>
9797
</dependency>
98+
<dependency>
99+
<groupId>org.hibernate</groupId>
100+
<artifactId>hibernate-c3p0</artifactId>
101+
<version>[5.6.10.Final,5.999.999.Final]</version>
102+
<scope>runtime</scope>
103+
</dependency>
98104
</dependencies>
99105

100106
<build>

sample/src/main/resources/META-INF/persistence.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
value="drop-and-create"/>
2121
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
2222
<property name="hibernate.show_sql" value="true" />
23-
<!-- WARN: this uses hibernate internal connection pool, not suitable for production -->
24-
<property name="hibernate.connection.pool_size" value="3" />
23+
<property name="hibernate.c3p0.maxPoolSize" value="3" />
24+
<property name="hibernate.c3p0.maxStatementsPerConnection" value="5" />
2525
</properties>
2626
</persistence-unit>
2727
</persistence>

0 commit comments

Comments
 (0)