Spring数据和oracle数据加载速度慢

时间:2015-08-18 13:08:39

标签: java oracle spring-boot spring-data spring-data-jpa

我正在使用spring-data和oracle数据库开发一个Spring-boot应用程序。我有几个非常简单的表,但数据的加载速度很慢。

例如,从只有3列(文本)的表中加载2000行的时间大约为25秒。我之前使用的是弹簧数据,但没有使用弹簧靴,而且速度并不慢。我只有一个资源文件application.properties,就在这里。

spring.datasource.url = jdbc:oracle:thin:@1.2.3.4:1521:abcd
spring.datasource.username = user
spring.datasource.password = ____
spring.datasource.driverClassName = oracle.jdbc.driver.OracleDriver
spring.datasource.maxActive=15
spring.datasource.initialSize=5
spring.datasource.validationQuery=select 1
spring.datasource.removeAbandoned=false
spring.datasource.testOnBorrow=true
spring.datasource.testOnReturn=true

spring.jpa.database-platform = org.hibernate.dialect.Oracle10gDialect

我一直在尝试使用findAll()等默认存储库实现以及自定义@Query,它是一样的。

我是否需要一些额外的配置?有什么想法吗?

1 个答案:

答案 0 :(得分:0)

在配置属性中,您应该使用 spring.jpa.properties.hibernate.jdbc.fetch_size