Home » Tag Archives: JBoss Hibernate (page 4)

Tag Archives: JBoss Hibernate

JPA Hibernate Alternatives. What can I use if JPA or Hibernate is not good enough for my project?

java-interview-questions-answers

Hello, how are you? Today we will talk about situations that the use of the JPA/Hibernate is not recommended. Which alternatives do we have outside the JPA world? What we will talk about:             JPA/Hibernate problems Solutions to some of the JPA/Hibernate problems Criteria for choosing the frameworks described here Spring JDBC Template MyBatis Sormula ...

Read More »

How to customize Hibernate dirty checking mechanism

java-interview-questions-answers

Introduction In my previous article I described the Hibernate automatic dirty checking mechanism. While you should always prefer it, there might be times when you want to add your own custom dirtiness detection strategy. Custom dirty checking strategies Hibernate offers the following customization mechanisms:   Hibernate Interceptor#findDirty() CustomEntityDirtinessStrategy A manual dirty checking exercise As an exercise, I’ll build a manual ...

Read More »

The anatomy of Hibernate dirty checking

jboss-hibernate-logo

Introduction The persistence context enqueues entity state transitions that get translated to database statements upon flushing. For managed entities, Hibernate can auto-detect incoming changes and schedule SQL UPDATES on our behalf. This mechanism is called automatic dirty checking.           The default dirty checking strategy By default Hibernate checks all managed entity properties. Every time an entity ...

Read More »

The dark side of Hibernate AUTO flush

jboss-hibernate-logo

Introduction Now that I described the the basics of JPA and Hibernate flush strategies, I can continue unraveling the surprising behavior of Hibernate’s AUTO flush mode. Not all queries trigger a Session flush Many would assume that Hibernate always flushes the Session before any executing query. While this might have been a more intuitive approach, and probably closer to the ...

Read More »

A beginner’s guide to JPA/Hibernate flush strategies

jboss-hibernate-logo

Introduction In my previous post I introduced the entity state transitions Object-relational mapping paradigm. All managed entity state transitions are translated to associated database statements when the current Persistence Context gets flushed. Hibernate’s flush behavior is not always as obvious as one might think.       Write-behind Hibernate tries to defer the Persistence Context flushing up until the last ...

Read More »

Hibernate Statistics with Hawtio and Jolokia

jboss-hibernate-logo

A huge part of enterprise Java deals with data. Among all the different ways of working with data in enterprise settings, there is still the proven and widely taught approach to use O/R mapping of any kind. The JPA standard makes this comparably easy to use for everybody and it should also be portable. But let’s not talk about migration ...

Read More »

A beginner’s guide to JPA/Hibernate entity state transitions

jboss-hibernate-logo

Introduction Hibernate shifts the developer mindset from SQL statements to entity state transitions. Once an entity is actively managed by Hibernate, all changes are going to be automatically propagated to the database. Manipulating domain model entities (along with their associations) is much easier than writing and maintaining SQL statements. Without an ORM tool, adding a new column requires modifying all ...

Read More »

Hibernate hidden gem: the pooled-lo optimizer

jboss-hibernate-logo

Introduction In this post we’ll uncover a sequence identifier generator combining identifier assignment efficiency and interoperability with other external systems (concurrently accessing the underlying database system). Traditionally there have been two sequence identifier strategies to choose from.         The sequence identifier, always hitting the database for every new value assignment. Even with database sequence preallocation we have ...

Read More »

From JPA to Hibernate’s legacy and enhanced identifier generators

jboss-hibernate-logo

JPA identifier generators JPA defines the following identifier strategies:                 Strategy Description AUTO The persistence provider picks the most appropriate identifier strategy supported by the underlying database IDENTITY Identifiers are assigned by a database IDENTITY column SEQUENCE The persistence provider uses a database sequence for generating identifiers TABLE The persistence provider uses a ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.