<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hibernate on Professional developer</title><link>https://www.professionaldev.dev/tags/hibernate/</link><description>Recent content in Hibernate on Professional developer</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 19 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.professionaldev.dev/tags/hibernate/index.xml" rel="self" type="application/rss+xml"/><item><title>Fastest MS SQL Inserts — Part 5: Hibernate Tuning</title><link>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part5/</link><pubDate>Mon, 19 Oct 2026 00:00:00 +0000</pubDate><guid>https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part5/</guid><description>
&lt;p&gt;In &lt;a href="https://www.professionaldev.dev/post/java/mssqlserver/persist_vs_saveall/"&gt;Part 1&lt;/a&gt; we watched Spring Data's &lt;code&gt;saveAll()&lt;/code&gt; take
7x longer than batched &lt;code&gt;persist()&lt;/code&gt; because every entity triggers a SELECT before its INSERT. In
&lt;a href="https://www.professionaldev.dev/post/java/mssqlserver/fast_insert_part2/"&gt;Part 2&lt;/a&gt; we switched to raw JDBC and cut the time
further. But Hibernate still sits well behind — so how close can it actually get to the bare metal?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Three settings close 80% of the gap:&lt;/strong&gt; implement &lt;code&gt;Persistable&lt;/code&gt; to kill the pre-INSERT SELECTs
(8x faster saveAll), use &lt;code&gt;StatelessSession&lt;/code&gt; to drop the first-level cache (35% faster persist), and
layer &lt;code&gt;useBulkCopyForBatchInsert=true&lt;/code&gt; on top (another 2–2.5x). Combined with proper batch sizing,
this is as fast as Hibernate gets.&lt;/p&gt;</description></item></channel></rss>