Hibernate Bandwidth Issue: Taking a lot more time than SQL Developer

#1

Hi guys,

I am experiencing a strange issued with Hibernate. I am running a simple query that return around 300.000 results

select COLUMN_A, COLUMN_B, COLUMN_C, COLUMN_D, COLUMN_E, COLUMN_F
from MY_TABLE
where COLUMN_G = ‘Reporting’;

In SQL developer is taking around 1 minute. But in Hibernate is taking 4 minutes.

    String queryString = "select COLUMN_A, COLUMN_B, COLUMN_C, COLUMN_D, COLUMN_E, COLUMN_F from MY_TABLE where COLUMN_G = 'Reporting'";
    Query query = entityManager.createNativeQuery(queryString, Reporting.class);
    List<ReportingScore> result = query.getResultList();

I don’t think the overhead of Hibernate creating the objects is the cause of the issue.

I noticed by looking to the Windows task manager when SQL Developer is executing the query, the bandwidth is in average 1.1Mbps

But when Hibernate is executing the very same query it is receiving the response at a pace of 300Kbps (1/3 slower).

Does anyone knows why hibernate data transfer is slower than in this case slower that SQL Developer?
Is there anyway to configure how hibernate control the bandwidth? (i never heard anything about it)

My application is a spring-boot application with version 2.1.1.RELEASE.

Thank you very much

#2

Out of curiosity, which JDBC driver are you using?

#3

this is the jar we are using:

        <dependency>
            <groupId>com.oracle.jdbc</groupId>
            <artifactId>ojdbc7</artifactId>
            <version>12.1.0.1.0</version>
        </dependency>

Thank you very much