SQL Zone is brought to you in partnership with:
  • submit to reddit
Vlad Mihalcea08/29/14
0 replies

The Anatomy of Hibernate Dirty Checking

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.

Madolyn Sullivan08/28/14
0 replies

Sequence Values in NuoDB

Ever wonder why your Sequence numbers in NuoDB are not necessarily assigned in sequential order?

Jonas Gauffin08/26/14
0 replies

How to Create a SqlException

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.

Hebert Coelho D...08/25/14
4 replies

JPA Hibernate Alternatives: When JPA & Hibernate Aren't Right for Your Project

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?

Chris Travers08/25/14
0 replies

Math and SQL Part 5: Projection and Selection

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.

Alec Noller08/24/14
0 replies

The Best of the Week (Aug. 15): SQL Zone

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.

Lukas Eder08/22/14
0 replies

A Wonderful SQL Feature: Quantified Comparison Predicates (ANY, ALL)

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.

Peter Zaitsev08/22/14
0 replies

5 Great New Features From Percona Cloud Tools for MySQL

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…

Matt Butcher08/21/14
0 replies

Database Storage in Go with Structable

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.

Alec Noller08/21/14
1 replies

PostgreSQL Wishlists: What Users Want to See in 9.5

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.

Lukas Eder08/20/14
0 replies

The Difference Between ROW_NUMBER(), RANK(), and DENSE_RANK()

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.

Chris Travers08/19/14
0 replies

Math and SQL, Part 4: Basic Data Types - Sets, Tuples, and Bags

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.

Sayem Ahmed08/18/14
0 replies

JPA Tutorial: Setting Up JPA in a Java SE Environment

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.

Alec Noller08/17/14
0 replies

The Best of the Week (Aug. 8): SQL Zone

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.

Vlad Mihalcea08/15/14
0 replies

The Dark Side of Hibernate Auto Flush

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.

Anders Karlsson08/15/14
0 replies

Script to Manage MaxScale

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.

Robert Diana08/15/14
0 replies

Geek Reading: August 14, 2014

These items are a combination of tech business news, development news and programming tools and techniques.

Michael Mainguy08/14/14
3 replies

Avoid Hibernate Anemia and Reduce Code Bloat

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.

Lukas Eder08/14/14
0 replies

SQL Tip of the Day: Be Wary of SELECT COUNT(*)

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?

Alec Noller08/13/14
0 replies

Dev of the Week: Markus Winand

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.

Drew Harvey08/13/14
0 replies

MySQL Find and Replace (REPLACE)

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.

Adrian Hills08/13/14
0 replies

dm_exec_query_plan Returning NULL Query Plan

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.

Chris Travers08/12/14
0 replies

Math and SQL Part 3: MVCC, Immutability, and Functional Programming

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.

Peter Zaitsev08/12/14
0 replies

MariaDB: Selective Binary Logs Events

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.

Vlad Mihalcea08/11/14
0 replies

A Beginner's Guide To JPA/Hibernate Flush Strategies

Hibernate’s flush behavior is not always as obvious as one might think.