Yasin Koyuncu (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *created* an issue
Hibernate Search (
https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiNmVlNzE4...
) / Improvement (
https://hibernate.atlassian.net/browse/HSEARCH-4716?atlOrigin=eyJpIjoiNmV...
) HSEARCH-4716 (
https://hibernate.atlassian.net/browse/HSEARCH-4716?atlOrigin=eyJpIjoiNmV...
) JDBC Batch performance affected by event box sequence generator (
https://hibernate.atlassian.net/browse/HSEARCH-4716?atlOrigin=eyJpIjoiNmV...
)
Issue Type: Improvement Affects Versions: 6.1.6.Final Assignee: Unassigned Components:
mapper-orm-coordination-outbox-polling Created: 12/Oct/2022 01:01 AM Priority: Minor
Reporter: Yasin Koyuncu (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
)
We are using jdbc batching and I noticed the bottleneck was these queries which were
executed too often:
select nextval ('hsearch_outbox_event_generator')
Then I’ve looked a bit in the code and found this entity mapping:
in org.hibernate.search.mapper.orm.coordination.outboxpolling.event.impl.
OutboxPollingOutboxEventAdditionalJaxbMappingProducer
public static final String ENTITY_DEFINITION = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n" +
"<hibernate-mapping>\n" +
" <class name=\"" + CLASS_NAME + "\"
entity-name=\"" + ENTITY_NAME + "\" table=\"" + TABLE_NAME +
"\">\n" +
" <id name=\"id\" type=\"long\">\n" +
" <generator
class=\"org.hibernate.id.enhanced.SequenceStyleGenerator\">\n" +
" <param name=\"sequence_name\">" +
TABLE_NAME + "_GENERATOR</param>\n" +
" <param name=\"table_name\">" + TABLE_NAME
+ "_GENERATOR</param>\n" +
" <param
name=\"initial_value\">1</param>\n" +
" <param
name=\"increment_size\">1</param>\n" +
" </generator>\n" +
" </id>\n" +
" <property name=\"entityName\" type=\"string\"
length=\"256\" nullable=\"false\" />\n" +
" <property name=\"entityId\" type=\"string\"
length=\"256\" nullable=\"false\" />\n" +
" <property name=\"entityIdHash\" type=\"integer\"
index=\"entityIdHash\" nullable=\"false\" />\n" +
" <property name=\"payload\"
type=\"materialized_blob\" nullable=\"false\" />\n" +
" <property name=\"retries\" type=\"integer\"
nullable=\"false\" />\n" +
" <property name=\"processAfter\" type=\"Instant\"
index=\"processAfter\" nullable=\"true\" />\n" +
" <property name=\"status\" index=\"status\"
nullable=\"false\">\n" +
" <type name=\"org.hibernate.type.EnumType\">\n"
+
" <param name=\"enumClass\">" +
OutboxEvent.Status.class.getName() + "</param>\n" +
" </type>\n" +
" </property>\n" +
" </class>\n" +
"</hibernate-mapping>\n";
In order to make less calls we can increase the following value:
{{ <param name=\"increment_size\">1</param>\n"}}
Is it possible to make this configurable?
Thx in advance,
Yasin
(
https://hibernate.atlassian.net/browse/HSEARCH-4716#add-comment?atlOrigin...
) Add Comment (
https://hibernate.atlassian.net/browse/HSEARCH-4716#add-comment?atlOrigin...
)
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=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100208- sha1:399748d )