Cheat Sheet: New Features in JPA 2.1

JPA 2.1 introduced 12 new features, like StoreProcedureQueries, Entity Graphs and Attribute Converter, to make your work with the database easier and more efficient.
Download your free New Features in JPA 2.1 cheat sheet now, to get all the information you need to improve your database access.

This 5 page cheat sheet brings you:

- a short description and
- code snippets for each feature,
- links to more detailed articles.

Signup now and get your free New Features in JPA 2.1 cheat sheet and regular blog updates.

I respect your privacy and have ZERO TOLERANCE for spam!

Showing posts with label Wildfly. Show all posts
Showing posts with label Wildfly. Show all posts

How to activate Hibernate Statistics to analyze performance issues

Did you ever ask yourself why a server request took ages on the production system while your local test system was just fine?
Well, we all had these situations and we will have several more of them in the future. In my experience, strange performance drops are often related to slow database queries. But which query causes the problem? And how to find it, if you can't or don't want to activate logging on your database?

The good news is, there is an easy way to do it. Hibernate can be configured to collect statistics and to provide the required information to analyze the database queries. So lets see what we need to do.


Testing with Aliens: How to test a JPA type converter with Arquillian

This post was written together with +Aslak Knutsen (@aslakknutsen).

JPA type converters provide an easy way to define how an entity attribute gets persisted to the database. You can use them to implement lots of different features, e.g. to encrypt your data as I showed in a previous post: How to use a JPA Type Converter to encrypt your data
But writing the type converter is not enough. We also need to make sure, that it is working correctly.

In general, there are two ways to test a type converter. We could write a unit test to check, if the conversion works correctly. But a unit test performs a test of the isolated class without putting it into the real execution environment. That means that we will still not know, if the converter works in one of our applications. If everything is set up correctly, the persistence provider will call the converter before writing to and after reading from the database. So we also need to check if the type converter gets called by the persistence provider and if everything works fine under that condition. We need to test the converter inside of the container we want to use for our application.
We will have a look at how this can be done with Arquillian and its persistence extension.

Wildfly 8.0.0.Beta1 Released - all major features and user facing EE7 APIs implemented

Wildfly 8.0.0.Beta1

Yesterday, the Wildfly team released Wildfly 8.0.0.Beta1!
The server is available at the Wildfly download page. If you want to read a detailed description of all changes, check the official release notes.

What's new?

Java EE 7 APIs
This is the first Wildfly version which implements all user facing EE7 APIs. This includes updates for JPA, Batch processing, Concurrency, JCA and others.
If you want to try Java EE7 features or have already done that, make sure to use to this version.

Port Reduction
The development team plans to reduce the number of used ports to two with 8.0.0.final. Port 8080 for the application and port 9990 for the management interface. This is done by multiplexing the different protocols over HTTP.
That goal is nearly achieved in this release. Beside the two mentioned ports, Wildfly uses the deprecated native management port 9999. This port will be removed in 8.0.0.Final release.

Management Role Based Access Control (RBAC) and Auditing
Now Wildfly supports RBAC to implement different permissions for the management interface.

Issues
The development team resolved 219 issues in this release.

Road Map

Based on the Wildfly JIRA, the road map for Wildfly 8 looks like this:
8.0.0.CR1     11/Nov/13
8.0.0.Final    25/Nov/13

Links

Wildfly download page
Release Notes
Road Map