Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.
For our French audience, you can watch Emmanuel Bernard’s Hibernate tu connais… mais en fait tu connais pas presentation that he presented at SnowCamp.
In this post, I’d like you to meet Martin, who, in spite of his young age, has been very active in the Hibernate Search project development, implementing some interesting extensions or helping with pull request reviewing.
Because I’d love to see more university students getting involved with open source software, I took this opportunity and interviewed Martin about this experience.
Hi, Martin. You are one of the youngest contributors we’ve ever had. Can you please introduce yourself?
Hi, Vlad. I am a 22-year-old Master’s Degree student at University of Bayreuth, Germany and have been interested in Hibernate Search and Fulltext Search (Lucene, Solr) for quite some time now. I am also a firm believer of Open Source and have actually always wanted to become a contributor of a tool (or software) many other developers use in their projects. Knowing that a piece of code you wrote is running in other systems is quite the rewarding feeling.
I understand that you took part in the Google Summer of Code event. Can you tell us a little bit about this program?
Yes, I took part in last year Google Summer of Code program and was mentored by Sanne Grinovero while working on adapting Hibernate Search to work with any JPA provider. It gave me the opportunity to dive more deeply into the codebase as it allowed me to concentrate on nothing but my project work-wise. In general Google Summer of Code is one of the best learning experiences any student that wants to get into Open Source can have.
Contributing to an open-source project is a great learning experience. Has this activity helped you improve your skills?
Definitely. While building new features or tracking down bugs, you encounter loads of different pieces of code you have to work through. With that comes learning new technologies and APIs. Also, the general process of submitting JIRA issues, discussing them and implementing the solutions is something you can learn while working on an open source project. Trying out the process yourself is invaluable and cannot be compared to just learning them on paper. This is also something I always tell to new coders: Try it out or you will not get it 100%.
Do you think the entry barrier is high for starting contributing to an open source project? How should we encourage students to getting involved with open source?
In the case of the Hibernate team, I can only say that it was quite easy to get into contact with the other developers. I just got onto IRC and asked questions about problems I had. They helped me with every question I had, so I stuck around. Then, I started reporting issues or making feature requests and was immediately incorporated into discussions. So no, the barrier is not high (at least for me in the case of the Hibernate team).
I think open source needs to be encouraged more at a university level. I think many students don’t realize what they are missing. Yes, open standards are encouraged and teaching uses open APIs all over the place, but universities tend to keep much of the work that is suitable for open source behind closed doors (btw: I don’t think that closed source is always a bad thing, but it sometimes is in the way of innovation).
What are your plans for the future?
Firstly, I want to finish my Masters degree at University. I haven’t fully decided yet, whether I want to stay at University or not. Time will tell, I guess. Secondly, I want to keep contributing to Hibernate Search and finish merging the features of last years Google Summer of Code into the core code base.
Thank you, Martin, and keep up the good work.
Welcome to the Hibernate community newsletter in which we share blog posts, forum and StackOverflow questions that are especially relevant to our users.
The new User Guide is online, and it’s now the default Hibernate reference documentation. We keep on improving it, and the next release will contain a chapter about Hibernate Spatial, a section about calling stored procedures, and an update to the Multi-tenancy chapter.
Sanne talked about Hibernate Search and Lucene at the London Lucene/Solr Meetup. I hope the recordings will be available soon.
Bozhidar Bozhanov wrote a step-by-step guide for integrating Hibernate, Spring, and Infinispan.
Dane Dennis, from JArchitect, analyzed the Hibernate Core API and concluded that Hibernate is a "good example of open source projects to learn from".
While running some tests on all major relational database systems, I bumped into a very interesting issue relating to MySQL metadata locking. The bottom line is that you a transaction should always end as otherwise locks might be held, therefore impacting other concurrent transactions.
We are glad to announce that the new Hibernate ORM User Guide has become the default Hibernate 5.1 reference documentation. This process was started last summer, and it was one of the primary goals of the Hibernate 5 project version.
Previously, all the documentation was written in DocBook, and we wanted to move away to a more human-friendly format. Thanks to Dan Allen and the Asciidoctor community, we now have a tool to write technical documentation where the actual content doesn’t get lost in a myriad of XML markup tags.
All the examples are embedded from unit tests which are, of course, available on GitHub. This way, we ensure that all code snippets are valid and relevant in the future as well (removing a deprecated class will trigger a test failure, and we can immediately update the broken example).
The previous documentation was featuring many XML-based examples which were no longer relevant for the vast majority of our users. Because it is very common to use Hibernate as a JPA provider, most examples are written according to the Java Persistence API specifications but, since Hibernate is more than a JPA provider, we also feature Hibernate-specific examples which cover use cases that are not supported by the JPA standard.
As previously stated, the User Guide is not finished yet. In the near future, we are going to enhance the following sections as well:
Hibernate support for calling stored procedures,
Migrating Hibernate Envers examples to unit tests,
A new section about Hibernate Spatial.
Enjoy reading it and we are looking forward to getting your feedback!
Starting this year, we are hosting a series of articles focused on the Hibernate community. We share blog posts, forum and StackOverflow questions that are especially relevant to our users.
We are happy that Hibernate 5.1 is ready. The new User Guide still needs a few site-related changes in order to make the switch, so stay tuned!
Ondrej Mihályi made a summary of the differences in JPA entity locking modes.
Lorenzo Dee wrote an article about JPA pitfalls.
Javin Paul describes why JPA and Hibernate entity classes shouldn’t be final.
I wrote an article about enabling bytecode enhancement in Hibernate 5.
Eugen Paraschiv wrote a very detailed article about auditing entity changes, comparing JPA callback annotations with Hibernate Envers and Spring Data JPA Auditing.
The guys at Plumbr have raised awareness of how the MySQL JDBC driver handles database-generated warning messages. We created a JIRA issue for this, and we’re discussing various possibilities for handling it without affecting other database drivers which are more efficient in this regard.
I wrote an article about the
AUTO flush mode handling strategies employed by the Hibernate implementation of the Java Persistence API and the Hibernate native API.
WildFly 10 has just been released with support for Hibernate 5.
Thorben Janssen recorded a video explaining the first-level cache.
A very interesting project is Apache Trafodion, which aims to build a transactional SQL engine on top of Hadoop. We’d like to thanks the Trafodion team for writing a Hibernate Dialect, therefore making it possible to access Hadoop from a Hibernate data access layer. Give it a try and let us know what you think.
Thorben Janssen wrote an article about calling native SQL queries from JPA.
Romain Manni-Bucau demonstrates how you can integrate JPA pagination with Java 8 Streams.
Happy New Year, everyone!
Starting this year, we are going to host a series of articles focused on the Hibernate community. We are going to share blog posts, forum and StackOverflow questions, that are especially relevant to our users.
Thorben Janssen, who regularly writes about JPA and Hibernate topics, has summarized the most typical logging configurations in a Hibernate Logging Guide.
For our Portuguese readers, Rafael Ponte has written a very interesting article about bidirectional relationships and the caveats of not properly synchronizing both ends of a bidirectional association.
One topic, I always wanted to investigate in great details, is about the aggressive connection release behavior employed for JTA transactions. For high-performance data access platforms, it’s worth checking if the Java EE application server can operate successfully even without aggressive connection release.
For my first post, I’d like to share the experience of running the in.relation.to blog on my Windows machine.
All the blog content is available on GitHub, and you can practically run the whole site on your local environment.
The Hibernate blog is built with awestruct from Asciidoctor files, and getting all the Ruby gems in place is definite not a walk in the park. To make matters worse, I’m running a Windows machine and all these Ruby gems are tightly coupled to Linux libraries, as I discovered after several failed attempts with the 64 bits Ruby 2.2.4 or the 32 bits Ruby 1.9.3.
Luckily, there is a dockerfile available, so building a Docker image and run it in a dedicated container can tackle the Ruby gem hell. Building the Docker image was fine, but running it was a three hours hackathon for both Emmanuel and I.
Docker images are immutable and all changes are wiped out once the container is terminated. Instead, we want the GitHub repository to be mirrored in the Docker container, so all changes are persisted even after shutting down the docker machine. This process can be done by mounting a host folder into the Docker container, which can happen upon running the Docker image. In our case, the mounted directory is the GitHub repository that’s mirrored inside the currently running Docker container.
Once the image is built, we need to run this command from within the GitHub repository folder:
docker run -t -i -p 4242:4242 -v `pwd`:/home/dev/in.relation.to hibernate/in.relation.to
This doesn’t work on Windows because Docker needs the OS paths to be prefixed with another slash.
So this command must be changed to:
docker run -t -i -p 4242:4242 -v '/'`pwd`:/home/dev/in.relation.to hibernate/in.relation.to
After running it, the mounted folder was just empty. We noticed that without the GitHub folder mounting part the Docker image could run properly, so the mounting process was the culprit.
After all sorts of hacks, Emmanuel had the idea of checking the Virtual Box Shared Folders, and, by default, only the
C:\Users directory is being shared.
No wonder it was not working all along.
All my repositories being on
D:\, we thought that adding a new shared path would fix this issue.
Well, it didn’t.
Docker must mount these Virtual Box shared folders too, but it only does so for
There’s a GitHub issue detailing this behavior, which you can watch if you are interested in this feature.
After moving the checkout GitHub repository to
/c/Users/Vlad/GitHub/in.relation.to, it all worked fine.
Welcome to the newly revamped Hibernate and friends blog.
As you can see, we made it look like hibernate.org and we took the opportunity to clean up the tags to make them more useful. But we had other reasons to migrate.
- Blog early, blog often
We have been very happy with the Asciidoctor-based writing experience of both our reference documentation and of hibernate.org. We are bringing this ease of writing to our blog and the not so secret objective is for us to blog more. So if you don’t see more content here, you can start yelling at us :)
- Write once, display anywhere
There is an added bonus to using Asciidoctor for all of our writing: we can move content easily between systems. What starts as a blog can easily become a how-to page on the site or a section in the reference documentation.
We had a few issues with the old infrastructure that were keeping us away from our IDEs a bit too often for comfort.
This blog is a statically generated site, we use Awestruct. This means that we can make is scale very easily and with very low maintenance. Nothing beats plain old HTML :)
We did migrate all the old entries and comments from the old blog: fear not, nothing is lost.