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.
Ever wonder why your Sequence numbers in NuoDB are not necessarily assigned in sequential order?
Have you tried to create a SqlException only to discover that the constructor is private? Here is how you can create the exception despite that.
Today we will talk about situations in which the use of the JPA/Hibernate is not recommended. What problems do JPA/Hibernate present, what are some solutions, and what alternatives do we have outside of the JPA world?
The SELECT statement is the workhorse of SQL. Updates and inserts are necessary, but selects are where the power is. One of the issues many people have in understanding these and using them is a clear understanding of the math involved, because there are a large number of implicit possibilities in the syntax.
Make sure you didn't miss anything with this list of the Best of the Week in the SQL Zone. This week's best include part of a series on Math & SQL, a tutorial for setting up JPA in a Java SE environment, a pair of PostgreSQL wishlists for Postgres 9.5, and more.
Have you ever wondered about the use-case behind SQL’s ANY (also: SOME) and ALL keywords? You have probably not yet encountered these keywords in the wild. Yet they can be extremely useful. But first, let’s see how they’re defined in the SQL standard.
Percona Cloud Tools for MySQL is a hosted service providing access to query performance insights for all MySQL uses. After a brief setup, unlock new information about your database and how to improve your applications. There’s a lot more, but let’s just look at these five new features…
I'm not a huge fan of ORMs. I usually feel more productive with my query writing when I can just write SQL. Okay, not always. Writing plain old CRUD queries is a mindless chore equivalent to scrubbing the toilet. So I wrote a little library called structable that takes care of the boilerplate CRUD for me.
It wasn't too long ago that we saw the release of PostgreSQL 9.4 Beta 1, but now there's talk of PostgreSQL 9.5 and, in particular, what sorts of changes it ought to bring. Two separate wishlists have been assembled in the last few days, each sporting a handful of hopes for 9.5.
One of the most obvious and useful set of window functions are ranking functions where rows from your result set are ranked according to a certain scheme. There are three ranking functions: ROW_NUMBER(), RANK(), and DENSE_RANK(). The difference is easy to remember.
A reasonable understanding of the relational model requires understanding the basic data types which make it up, both in the idealized model and in real-world applications. This post discusses both the idealized model and the accommodations the standard implementations of it make to the messiness of the real world.
When I first started out with JPA, I had real difficulties to set it up because most of the articles on the web are written for Java EE environment only, whereas I was trying to use it in a Java SE environment. I hope that this article will be helpful for those who wish to do the same in the future.
Make sure you didn't miss anything with this list of the Best of the Week in the SQL Zone. This week's best include a beginner's guide to JPA/Hibernate flush strategies, how to avoid Hibernate anemia and reduce code bloat, part of the Math and SQL series, and more.
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.
There are still some rough edges and stuff to be fixed in MaxScale 1.0, but it is clearly close to GA. One thing missing, though, is something to manage starting and stopping MaxScale in a somewhat controlled way, which is what this blog is all about.
These items are a combination of tech business news, development news and programming tools and techniques.
One of my beefs with Hibernate as an ORM is that it encourages anemic domain models that have no operations and are simply data structures.
Unfortunately, COUNT(*) is often the first solution that comes to mind when we want to check our relations for some predicate. But COUNT() is expensive, especially if all we’re doing is checking our relations for existence. Does the word ring a bell?
Every week, we feature a new developer/blogger from the DZone community to catch up and find out what he or she is working on now and what's coming next. This week we're talking to Markus Winand, author, trainer, and coach specializing in helping developers deal with SQL performance issues.
Ever had need to do a MySQL find and replace to quickly replace some data in your database? Fear not, MySQL has a nifty little string function, REPLACE, that allows a user to find and replace instances of a search string with a substitution string.
I recently hit a scenario (SQL Server 2012 Standard, 11.0.5058) where I was trying to pull out the execution plan for a stored procedure from the plan cache, but one query was returning a NULL query plan.
While first normal form is pretty much restricted to relational operations, this piece is more general. It looks at the basic promise of functional programming, and the way that this applies to PostgreSQL. In the mean time, we will also look at a fully functional approach to a key-value store in Perl as a close analogue.
In the first post in a series on MariaDB features we find interesting, we begin with selectively skipping replication of binlog events. This feature is available on MariaDB 5.5 and 10.
Hibernate’s flush behavior is not always as obvious as one might think.