[JIRA] (HHH-15583) Trying to accomplish Insert bulk query with hibernate
by Karthik Anantharaju (JIRA)
Karthik Anantharaju ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=633ef75... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNmYyMGM3MDJk... ) / Bug ( https://hibernate.atlassian.net/browse/HHH-15583?atlOrigin=eyJpIjoiNmYyMG... ) HHH-15583 ( https://hibernate.atlassian.net/browse/HHH-15583?atlOrigin=eyJpIjoiNmYyMG... ) Trying to accomplish Insert bulk query with hibernate ( https://hibernate.atlassian.net/browse/HHH-15583?atlOrigin=eyJpIjoiNmYyMG... )
Issue Type: Bug Assignee: Unassigned Created: 06/Oct/2022 10:51 AM Priority: Major Reporter: Karthik Anantharaju ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=633ef75... )
We are working on a spring boot api which uses hibernate to insert into database. We are trying to insert multiple items in bulk to database as follows:
insert into table (col1, col2) values (x1, y1), (x2, y2), (x3, y3);
We tried using existing hibernate api parameters such as jdbc.batch_size , but it shows individual insert statement to database in sql logs with show-sql: true as below.
insert into table (col1, col2) values (x1, y1);
insert into table (col1, col2) values (x2, y2);
Is there an hibernate api or configuration that we can use to achieve bulk insert as below?
insert into table (col1, col2) values (x1, y1), (x2, y2), (x3, y3);
( https://hibernate.atlassian.net/browse/HHH-15583#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-15583#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:b857cee )
2 years, 2 months
[JIRA] (HHH-15525) Allow Global- and PersistentTemporaryTableStrategy to participate in hbm2ddl
by Kai Zander (JIRA)
Kai Zander ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-15525 ( https://hibernate.atlassian.net/browse/HHH-15525?atlOrigin=eyJpIjoiYWQ5NT... )
Re: Allow Global- and PersistentTemporaryTableStrategy to participate in hbm2ddl ( https://hibernate.atlassian.net/browse/HHH-15525?atlOrigin=eyJpIjoiYWQ5NT... )
Actually, when running against Oracle ( org.hibernate.dialect.OracleDialect ), Hibernate still attempts to create the temporary tables at application start. These statements then fail quietly (no exceptions are being thrown/logged):
2022-10-06T16:25:05.281Z INFO o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-10-06T16:25:05.307Z INFO org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.4.Final
2022-10-06T16:25:05.402Z WARN org.hibernate.orm.deprecation : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2022-10-06T16:25:05.521Z INFO SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.OracleDialect
2022-10-06T16:25:06.338Z DEBUG org.hibernate.SQL : create global temporary table OWNER.HTE_tab_data(id number(19,0), col1 varchar2(255 char), col2 varchar2(255 char), col3 varchar2(255 char), rn_ number(10,0) not null, primary key (rn_)) on commit delete rows
2022-10-06T16:25:06.397Z DEBUG org.hibernate.SQL : create global temporary table OWNER.HTE_tab_data_staging(id number(19,0), col1 varchar2(255 char), col2 varchar2(255 char), col3 varchar2(255 char), rn_ number(10,0) not null, primary key (rn_)) on commit delete rows
2022-10-06T16:25:07.173Z INFO o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-10-06T16:25:07.180Z INFO j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
However, this is not that critical to us, because at runtime, Hibernate does not attempt to use these tables.
( https://hibernate.atlassian.net/browse/HHH-15525#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-15525#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:b857cee )
2 years, 2 months