Skip to content

Conversation

@dreab8
Copy link
Member

@dreab8 dreab8 commented Feb 20, 2025

Fix #2108

@dreab8
Copy link
Member Author

dreab8 commented Feb 26, 2025

Unfortunately with this change it works but only in conjunction with hibernate.jdbc.batch_size > 1.
I'm working on a change that should allow insertAll(int batchSize, Object... entities) to respect the batchSize even when hibernate.jdbc.batch_size is not set.

@gavinking
Copy link
Member

@dreab8 you see how I did it in ORM, right?

	@Override
	public void insertMultiple(List<?> entities) {
		final Integer batchSize = getJdbcBatchSize();
		setJdbcBatchSize( entities.size() );
		try {
			for ( Object entity : entities ) {
				insert( null, entity );
			}
		}
		finally {
			setJdbcBatchSize( batchSize );
		}
	}

@dreab8
Copy link
Member Author

dreab8 commented Feb 26, 2025

In reactive we need also to use a BatchingConnection and at the moment if batcSize <2 we use the original connection also for the batchingHelperSession

Preparing a PR.

@dreab8
Copy link
Member Author

dreab8 commented Feb 26, 2025

@gavinking #2136

@dreab8
Copy link
Member Author

dreab8 commented Mar 3, 2025

superseeded by #2136

@dreab8 dreab8 closed this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StatelessSession insertAll in batch does not do batching

3 participants